Texture

Base rendering class.

Constructors

this
this(Texture texture)

Ctor

this
this(SDL_Surface* surface, bool preload_, bool isSmooth_)

Ctor

this
this(string path, bool preload_, bool isSmooth_)

Ctor

Destructor

~this
~this()
Undocumented in source.

Members

Functions

draw
void draw(Vec2f pos, Vec2f anchor)

Render the whole texture here

draw
void draw(Vec2f pos, Vec4i srcRect, Vec2f anchor)

Render a section of the texture here

draw
void draw(Vec2f pos, Vec2f size, Vec2f anchor)

Render the whole texture here

draw
void draw(Vec2f pos, Vec2f size, Vec4i srcRect, Vec2f anchor)

Render a section of the texture here

draw
void draw(Vec2f pos, Vec2f size, Vec4i srcRect, float angle, Flip flip, Vec2f anchor)

Render a section of the texture here

load
void load(SDL_Surface* surface)
Undocumented in source. Be warned that the author may not have intended to support it.
load
void load(string path)

Load from file

postload
void postload()

Call it if you set the preload flag on ctor.

unload
void unload()

Free image data

Properties

alpha
float alpha [@property getter]
float alpha [@property setter]

Alpha

blend
Blend blend [@property getter]
Blend blend [@property setter]

Blending algorithm.

color
Color color [@property getter]
Color color [@property setter]

Color added to the canvas.

height
uint height [@property getter]

Height in texels.

isLoaded
bool isLoaded [@property getter]

loaded ?

width
uint width [@property getter]

Width in texels.

Inherited Members

From Drawable

isLoaded
bool isLoaded [@property getter]

loaded ?

width
uint width [@property getter]

Width in texels.

height
uint height [@property getter]

Height in texels.

color
Color color [@property getter]
Color color [@property setter]

Color added to the renderable.

alpha
float alpha [@property getter]
float alpha [@property setter]

Alpha

blend
Blend blend [@property getter]
Blend blend [@property setter]

Blending algorithm.

draw
void draw(Vec2f pos, Vec2f anchor)

Render the whole texture here

draw
void draw(Vec2f pos, Vec4i srcRect, Vec2f anchor)

Render a section of the texture here

draw
void draw(Vec2f pos, Vec2f size, Vec2f anchor)

Render the whole texture here

draw
void draw(Vec2f pos, Vec2f size, Vec4i srcRect, Vec2f anchor)

Render a section of the texture here

draw
void draw(Vec2f pos, Vec2f size, Vec4i srcRect, float angle, Flip flip, Vec2f anchor)

Render a section of the texture here

Meta