Constructor
new TextureRenderable(myTexture) → {TextureRenderable}
Parameters:
| Name | Type | Description |
|---|---|---|
myTexture |
string | the path to the image file to use as texture |
Returns:
a new TextureRenderable instance
- Type
- TextureRenderable
Extends
- Renderable
Methods
draw(camera)
Draw this TextureRenderable to the camera
Parameters:
| Name | Type | Description |
|---|---|---|
camera |
Camera | the Camera to draw this TextureRenderable to draw to |
getTexture() → {string}
Return the path to image file associated with this TextureRenderable
Returns:
mTexture - path to image file
- Type
- string
pixelTouches(other, wcTouchPos) → {boolean}
Determines if this GameObject has an overlapping pixel with otherObj
Parameters:
| Name | Type | Description |
|---|---|---|
other |
TextureRenderable | the other TextureRenderable |
wcTouchPos |
vec2 | vector to store the first world coordinates where the pixels touch |
Returns:
pixelTouch - whether this TextureRenderable has a pixel overlapping the other
- Type
- boolean
setColorArray()
If the color array is null sets the color array of this TextureRenderable to the color array of its texture
setTexture(newTexture)
Set the image file to serve as the texture for this TextureRenderable
Parameters:
| Name | Type | Description |
|---|---|---|
newTexture |
string | path to new image file |