CrabUI
|
Wrapper Containing link to texture and drawing settings,
like SourceRedt, DrawMode, Effects, Rotation...
Multiple sprites can use the same texture.
More...
Public Member Functions | |
override bool | Equals (object obj) |
CUISprite () | |
Default 1x1 white sprite. | |
CUISprite (string path, Rectangle? sourceRect=null, string baseFolder=null) | |
CUISprite (Texture2D texture, Rectangle? sourceRect=null) | |
object | Clone () |
override string | ToString () |
Static Public Member Functions | |
static CUISprite | FromVanilla (Sprite sprite) |
Creates a CUISprite from vanilla Sprite. | |
static CUISprite | FromName (string name) |
Uses vanilla GUI sprite from GUIStyle.ComponentStyles with this name. | |
static CUISprite | FromId (Identifier id) |
static CUISprite | FromComponentStyle (GUIComponentStyle style, GUIComponent.ComponentState state=GUIComponent.ComponentState.None) |
static CUISprite | Parse (string raw) |
static CUISprite | ParseWithContext (string raw, string baseFolder=null) |
Public Attributes | |
string | Path = "" |
Set when you load it from some path. | |
SpriteEffects | Effects |
None, FlipHorizontally, FlipVertically. | |
CUISpriteDrawMode | DrawMode |
Resize - will resize the sprite to component Wrap - will loop the texture Static - sprite ignores component position. | |
Rectangle | SourceRect |
Part of the texture that is drawn Won't work in Wrap mode becase it will loop the whole texture. | |
float | Rotation |
In radians. | |
Vector2 | Origin |
Origin of rotation in pixels. | |
Properties | |
static Texture2D | BackupTexture [get] |
1x1 white texture | |
static CUISprite | Default [get] |
new Sprite that uses 1x1 default texture | |
Texture2D | Texture [get, set] |
The link to the texture Multiple sprites can use the same texture. | |
float | RotationAngle [get, set] |
In degree. | |
Vector2 | RelativeOrigin [set] |
Origin of rotation in [0..1] of texture size. | |
Vector2 | Offset [get, set] |
Draw offset from CUIComponent Position For your convenience also sets origin. | |
static string | BaseFolder [get, set] |
When you load sprite from file, relative paths are considered relative to barotrauma folder if BaseFolder != null sprite will check files in BaseFolder first Don't forget to set it back to null. | |
Wrapper Containing link to texture and drawing settings,
like SourceRedt, DrawMode, Effects, Rotation...
Multiple sprites can use the same texture.
Definition at line 26 of file CUISprite.cs.
CrabUI.CUISprite.CUISprite | ( | ) |
Default 1x1 white sprite.
Definition at line 166 of file CUISprite.cs.
CrabUI.CUISprite.CUISprite | ( | string | path, |
Rectangle? | sourceRect = null, | ||
string | baseFolder = null ) |
Definition at line 171 of file CUISprite.cs.
CrabUI.CUISprite.CUISprite | ( | Texture2D | texture, |
Rectangle? | sourceRect = null ) |
Definition at line 186 of file CUISprite.cs.
object CrabUI.CUISprite.Clone | ( | ) |
Definition at line 192 of file CUISprite.cs.
override bool CrabUI.CUISprite.Equals | ( | object | obj | ) |
Definition at line 112 of file CUISprite.cs.
|
static |
Definition at line 150 of file CUISprite.cs.
|
static |
Definition at line 142 of file CUISprite.cs.
|
static |
|
static |
Definition at line 221 of file CUISprite.cs.
|
static |
Definition at line 266 of file CUISprite.cs.
override string CrabUI.CUISprite.ToString | ( | ) |
Definition at line 207 of file CUISprite.cs.
CUISpriteDrawMode CrabUI.CUISprite.DrawMode |
Resize - will resize the sprite to component
Wrap - will loop the texture
Static - sprite ignores component position.
Definition at line 50 of file CUISprite.cs.
SpriteEffects CrabUI.CUISprite.Effects |
None, FlipHorizontally, FlipVertically.
Definition at line 44 of file CUISprite.cs.
Vector2 CrabUI.CUISprite.Origin |
Origin of rotation in pixels.
Definition at line 85 of file CUISprite.cs.
string CrabUI.CUISprite.Path = "" |
Set when you load it from some path.
Definition at line 40 of file CUISprite.cs.
float CrabUI.CUISprite.Rotation |
In radians.
Definition at line 73 of file CUISprite.cs.
Rectangle CrabUI.CUISprite.SourceRect |
Part of the texture that is drawn
Won't work in Wrap mode becase it will loop the whole texture.
Definition at line 55 of file CUISprite.cs.
|
staticget |
1x1 white texture
Definition at line 31 of file CUISprite.cs.
|
staticgetset |
When you load sprite from file, relative paths are considered relative to barotrauma folder
if BaseFolder != null sprite will check files in BaseFolder first Don't forget to set it back to null.
Definition at line 161 of file CUISprite.cs.
|
staticget |
new Sprite that uses 1x1 default texture
Definition at line 35 of file CUISprite.cs.
|
getset |
Draw offset from CUIComponent Position
For your convenience also sets origin.
Definition at line 102 of file CUISprite.cs.
|
set |
|
getset |
In degree.
Definition at line 77 of file CUISprite.cs.
|
getset |
The link to the texture
Multiple sprites can use the same texture.
Definition at line 61 of file CUISprite.cs.