It provides display sprites.
Procs
proc Sprite(name: string; variable: var SpriteObj): SpritePtr {...}{.raises: [], tags: [].}
-
Creates a new Sprite pointer.
Arguments:
- name is a node name.
- variable is a SpriteObj variable.
Examples:
var node_obj: SpriteObj node = Sprite("Sprite", node_obj)
proc Sprite(obj: var SpriteObj): SpritePtr {...}{.inline, raises: [], tags: [].}
-
Creates a new Sprite pointer with deffault node name "Sprite".
Arguments:
- variable is a SpriteObj variable.
Examples:
var node_obj: SpriteObj node = Sprite(node_obj)
Methods
method draw(self: SpritePtr; w, h: GLfloat) {...}{.raises: [Exception, GLerror], tags: [RootEffect].}
- this method uses in the window.nim.
method duplicate(self: SpritePtr; obj: var SpriteObj): SpritePtr {...}{.base, raises: [], tags: [].}
- Duplicates Sprite object and create a new Sprite pointer.
method getGlobalMousePosition(self: SpritePtr): Vector2Ref {...}{.inline, raises: [], tags: [].}
- Returns mouse position.
method loadTexture(self: SpritePtr; file: cstring; mode = GL_RGB) {...}{.base, raises: [GLerror], tags: [].}
-
Loads a new texture from file.
Arguments:
- file is a texture path.
- mode is a GLenum. can be GL_RGB or GL_RGBA.
method setTexture(self: SpritePtr; texture: GlTextureObj) {...}{.base, raises: [], tags: [].}
-
Loads a new texture from file.
Arguments:
- texture is a GlTexture object.