It provides display sprites.
Methods
method draw(self: SpriteRef; w, h: GLfloat) {...}{.raises: [GLerror], tags: [].}
- this method uses in the window.nim.
method duplicate(self: SpriteRef): SpriteRef {...}{.base, raises: [], tags: [].}
- Duplicates Sprite object and create a new Sprite.
method getGlobalMousePosition(self: SpriteRef): Vector2Obj {...}{.inline, raises: [], tags: [].}
- Returns mouse position.
method loadTexture(self: SpriteRef; file: string; mode = GL_RGB) {...}{.base, raises: [GLerror, ResourceError], 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: SpriteRef; texture: GlTextureObj) {...}{.base, raises: [GLerror], tags: [].}
-
Loads a new texture from file.
Arguments:
- texture is a GlTexture object.