Skip to content

Commit 791b025

Browse files
committed
add doc for Vertex's new constructors
1 parent 9051bd8 commit 791b025

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

src/rsfml/graphics/vertex.rs

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl Vertex {
6363
* # Arguments
6464
* * position - Position of the vertex
6565
* * color - Color of the vertex
66-
* * texCoords - Texture coordinate of the vertex
66+
* * tex_coords - Texture coordinate of the vertex
6767
*
6868
* Return a Vertex
6969
*/
@@ -75,6 +75,16 @@ impl Vertex {
7575
}
7676
}
7777

78+
/**
79+
* Create a new default Vertex
80+
*
81+
* # Default
82+
* * position - (0., 0.)
83+
* * color - white
84+
* * tex_coords - (0., 0.)
85+
*
86+
* Return a Vertex
87+
*/
7888
pub fn default() -> Vertex {
7989
Vertex {
8090
position : Vector2f{ x : 0., y : 0. },
@@ -83,6 +93,18 @@ impl Vertex {
8393
}
8494
}
8595

96+
/**
97+
* Create a new Vertex whit a position
98+
*
99+
* # Arguments
100+
* * position - Position of the vertex
101+
*
102+
* # Default
103+
* * color - white
104+
* * tex_coords - (0., 0.)
105+
*
106+
* Return a Vertex
107+
*/
86108
pub fn new_with_pos(position : &Vector2f) -> Vertex {
87109
Vertex {
88110
position : *position,
@@ -91,6 +113,18 @@ impl Vertex {
91113
}
92114
}
93115

116+
/**
117+
* Create a new Vertex with the position and the color
118+
*
119+
* # Arguments
120+
* * position - Position of the vertex
121+
* * color - Color of the vertex
122+
*
123+
* # Default
124+
* * tex_coords - (0., 0)
125+
*
126+
* Return a Vertex
127+
*/
94128
pub fn new_with_pos_color(position : &Vector2f, color : &Color) -> Vertex {
95129
Vertex {
96130
position : *position,
@@ -99,6 +133,18 @@ impl Vertex {
99133
}
100134
}
101135

136+
/**
137+
* Create a new Vertex whit the position and the texture coordinates
138+
*
139+
* # Arguments
140+
* * position - Position of the vertex
141+
* * tex_coords - Texture coordinate of the vertex
142+
*
143+
* # Default
144+
* * color - white
145+
*
146+
* Return a Vertex
147+
*/
102148
pub fn new_with_pos_coords(position : &Vector2f, tex_coords : &Vector2f) -> Vertex {
103149
Vertex {
104150
position : *position,

0 commit comments

Comments
 (0)