-
Notifications
You must be signed in to change notification settings - Fork 2
Textures
Namespace: Fjord.Modules.Graphics
class: texture
NOTE: Any method that returns the texture class returns itself for method chaining!
- Function
void set_texture(string path)
- Example
texture.set_texture("Player.png")
This Example will set the texture for the texture class to a 'Player.png' image in the assets/images folder.
- Function
texture set_texture(IntPtr tex)
- Example
texture.set_texture(player_intptr_texture)
This Example will set the texture for the texture class to a already existing sdl2 intptr texture.
- Function
IntPtr get_texture()
- Example
IntPtr intptr_texture = texture.get_texture()
This Example will return the sdl2 intptr texture from the texture class.
- Function
texture set_origin(V2 origin)
- Example
texture.set_origin(new V2(0, 0))
This Example sets the origin of the texture to the top left of the texture.
- Function
texture set_origin(draw_origin set_origin)
- Example
texture.set_origin(draw_origin.TOP_LEFT)
This Example sets the origin of the texture to the top left using the draw_origin enumerator. This overload is prefered to using the V2 as it updates with the texture scaling.
- Function
V2 get_origin()
- Example
V2 texture_origin = texture.get_origin()
This Example returns the origin of the texture.
- Function
texture set_scale(V2f scale)
- Example
texture.set_scale(new V2f(2, 2))
This Example sets the scale of the texture to 2x of it's original size.
- Function
V2f get_scale()
- Example
V2f texture_scale = texture.get_scale()
This Example returns the scale of the texture.
- Function
texture set_fliptype(flip_type flip)
- Example
texture.set_fliptype(flip_type.horizontal)
This Example flips the texture horizontally when drawn.
- Function
flip_type get_fliptype()
- Example
flip_type texture_fliptype = texture.get_fliptype()
This Example returns the fliptype of the texture.
- Function
texture set_angle(double angle)
- Example
texture.set_angle(90)
This Example rotates the texture 90 degrees.
- Function
texture get_angle(double angle)
- Example
double texture_angle = texture.get_angle()
This Example returns the texture angle.
- Function
texture set_alpha(int alpha)
- Example
texture.set_alpha(100)
This Example will make the texture semi-transparent.
- Function
int get_alpha()
- Example
int texture_alpha = texture.get_alpha()
This Example returns the texture alpha.
- Function
texture set_depth(int depth)
- Example
texture.set_depth(20)
This Example sets the draw depth of the texture. Higher is closer the the camera.
- Function
int get_depth()
- Example
int texture_depth = texture.get_depth()
This Example returns the texture depth.
- Function
V2 get_size()
- Example
V2 texture_size = texture.get_size()
This Example returns the scaled texture size with the texture scaling. Eg. the size it will be drawn as to the screen.
- Function
V2 get_texture_size()
- Example
V2 texture_texture_size = texture.get_texture_size()
This Example returns the raw size of the texture without scaling.