Class TTexture
Stores friction maps.
Namespace: Tanvas.TanvasTouch.Resources
Assembly: Tanvas.TanvasTouch.dll
Syntax
public sealed class TTexture : TResource
Remarks
A TTexture is a byte array that represents two-dimensional friction maps in row-major order. Each element of the map is an integer between zero and 255. Zero represents the natural friction of the touchscreen surface; 255 represents the maximum amount of additional friction that the hardware can provide.
Each element in the friction map nominally represents a single on-screen pixel, but this can be changed by altering the texture mapping via TMaterial's UV coordinates and wrapping mode.
Constructors
TTexture()
Default constructor
Declaration
public TTexture()
Properties
Height
The height of the texture.
Declaration
public int Height { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Width
The width of the texture.
Declaration
public int Width { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
ReleaseHandle()
Declaration
protected override void ReleaseHandle()
Overrides
SetData(Byte[], Int32, Int32)
Sets the friction map for this TTexture.
Declaration
public void SetData(byte[] data, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Array of bytes representing the texture data. |
System.Int32 | width | Width of the texture data. |
System.Int32 | height | Height of the texture data. |
Remarks
This method makes a copy of the byte array passed to this method and uploads the new data
to the TanvasTouch Engine. Therefore, changes made to data
after
invoking this method will not be reflected in the TTexture;
you must invoke SetData again to upload the new texture data to the Engine.