-
Notifications
You must be signed in to change notification settings - Fork 0
Sprite2D
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.Sprite2D |
| Namespace | Electron2D |
| Kind | class |
| Category | Rendering |
Provides a node that submits a 2D texture for drawing.
public class Electron2D.Sprite2D : Electron2D.Node2DElectron2D.Sprite2D displays the assigned Electron2D.Texture2D or a
rectangular region of that texture.
Use Electron2D.AnimatedSprite2D with Electron2D.SpriteFrames for
frame-based texture animation.
This type is not synchronized. Create and mutate sprites on the main scene thread.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.AnimatedSprite2DElectron2D.Node2DElectron2D.Texture2D
| Member | Kind | Summary |
|---|---|---|
Centered |
Property | Gets or sets whether the texture is drawn centered on the node origin. |
FlipH |
Property | Gets or sets whether the texture is flipped horizontally. |
FlipV |
Property | Gets or sets whether the texture is flipped vertically. |
Offset |
Property | Gets or sets the local drawing offset. |
RegionEnabled |
Property | Gets or sets whether Electron2D.Sprite2D.RegionRect limits the sampled texture region. |
RegionFilterClipEnabled |
Property | Gets or sets whether filtering should clip to the enabled region. |
RegionRect |
Property | Gets or sets the source rectangle used when Electron2D.Sprite2D.RegionEnabled is true. |
Texture |
Property | Gets or sets the texture displayed by this sprite. |
Electron2D.Sprite2D() |
Constructor | Initializes a new instance of the Sprite2D type. |
GetRect() |
Method | Gets the local rectangle occupied by this sprite. |
IsPixelOpaque(Electron2D.Vector2) |
Method | Checks whether a local sprite position maps to an opaque texture pixel. |
Kind: Property
public System.Boolean Centered { get; set; }Gets or sets whether the texture is drawn centered on the node origin.
This property follows the validation and lifetime rules of its declaring type.
The current centered value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Sprite2D
Kind: Property
public System.Boolean FlipH { get; set; }Gets or sets whether the texture is flipped horizontally.
This property follows the validation and lifetime rules of its declaring type.
The current flip h value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Sprite2D
Kind: Property
public System.Boolean FlipV { get; set; }Gets or sets whether the texture is flipped vertically.
This property follows the validation and lifetime rules of its declaring type.
The current flip v value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Sprite2D
Kind: Property
public Electron2D.Vector2 Offset { get; set; }Gets or sets the local drawing offset.
This property follows the validation and lifetime rules of its declaring type.
The current offset value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Sprite2D
Kind: Property
public System.Boolean RegionEnabled { get; set; }Gets or sets whether Electron2D.Sprite2D.RegionRect limits the sampled texture region.
This property follows the validation and lifetime rules of its declaring type.
The current region enabled value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Sprite2D.RegionRect
Kind: Property
public System.Boolean RegionFilterClipEnabled { get; set; }Gets or sets whether filtering should clip to the enabled region.
This property follows the validation and lifetime rules of its declaring type.
The current region filter clip enabled value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Sprite2D
Kind: Property
public Electron2D.Rect2 RegionRect { get; set; }Gets or sets the source rectangle used when Electron2D.Sprite2D.RegionEnabled is true.
This property follows the validation and lifetime rules of its declaring type.
The current region rect value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Sprite2D
Kind: Property
public Electron2D.Texture2D Texture { get; set; }Gets or sets the texture displayed by this sprite.
If this property is null, the sprite remains part of the scene
tree but does not submit a draw command.
The current texture value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Sprite2D
Kind: Constructor
public Electron2D.Sprite2D()Initializes a new instance of the Sprite2D type.
The new instance follows the lifetime and validation rules of its declaring type.
This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.
This API is available since Electron2D 0.1.0 Preview.
Electron2D.Sprite2D
Kind: Method
public Electron2D.Rect2 GetRect()()Gets the local rectangle occupied by this sprite.
This method follows the validation and lifetime rules of its declaring type.
The local drawing rectangle derived from the texture size, region and offset.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Sprite2D
Kind: Method
public System.Boolean IsPixelOpaque(Electron2D.Vector2)(Electron2D.Vector2 pos)Checks whether a local sprite position maps to an opaque texture pixel.
This method follows the validation and lifetime rules of its declaring type.
-
pos: The position in the sprite's local drawing coordinates.
true if the mapped texture pixel is opaque; otherwise, false.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Sprite2D
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.