It provides a primitive display image.
Types
TextureRectObj = object of ControlPtr texture*: GLuint texture_mode*: TextureMode texture_size*: Vector2Ref texture_anchor*: AnchorRef texture_filter*: ColorRef
TextureRectPtr = ptr TextureRectObj
Procs
proc TextureRect(name: string; variable: var TextureRectObj): TextureRectPtr {...}{. raises: [], tags: [].}
-
Creates a new TextureRect pointer.
Arguments:
- name is a node name.
- variable is a TextureRectObj variable.
Examples:
var textureobj: TextureRectObj texture = TextureRect("TextureRect", textureobj)
proc TextureRect(obj: var TextureRectObj): TextureRectPtr {...}{.inline, raises: [], tags: [].}
-
Creates a new TextureRect pointer with default name "TextureRect".
Arguments:
- variable is a TextureRectObj variable.
Examples:
var textureobj: TextureRectObj texture = TextureRect(textureobj)
Methods
method draw(self: TextureRectPtr; w, h: GLfloat) {...}{.raises: [GLerror, Exception], tags: [RootEffect].}
- This uses in the window.nim.
method duplicate(self: TextureRectPtr; obj: var TextureRectObj): TextureRectPtr {...}{.base, raises: [], tags: [].}
- Duplicates TextureRect and create a new TextureRect pointer.
method loadTexture(self: TextureRectPtr; file: cstring) {...}{.base, raises: [GLerror], tags: [].}
-
Loads texture from file.
Arguments:
- file is an image file path.
method setTexture(self: TextureRectPtr; gltexture: GlTextureObj) {...}{.base, raises: [], tags: [].}
-
Changes texture.
Arguments:
- gltexture is a texture, loaded via load(file, mode=GL_RGB).
method setTextureFilter(self: TextureRectPtr; color: ColorRef) {...}{.base, raises: [], tags: [].}
- Changes texture filter color.
method setTextureAnchor(self: TextureRectPtr; anchor: AnchorRef) {...}{.base, raises: [], tags: [].}
- Changes texture anchor.
method setTextureAnchor(self: TextureRectPtr; x1, y1, x2, y2: float) {...}{.base, raises: [], tags: [].}
-
Changes texture anchor.
ARguments:
- x1 and y1 is an anchor relative to TextureRect size.
- x2 and y2 is an anchor relative to texture size.