Barotrauma Client Doc
|
Public Member Functions | |
override string | ToString () |
Sprite (ContentXElement element, string path="", string file="", bool lazyLoad=false) | |
Sprite (string newFile, Vector2 newOrigin) | |
Sprite (string newFile, Rectangle? sourceRectangle, Vector2? origin=null, float rotation=0) | |
void | Remove () |
void | ReloadXML () |
Works only if there is a name attribute defined for the sprite. For items and structures, the entity id or name is used if the sprite's name attribute is not defined. More... | |
bool | ParseTexturePath (string path="", string file="") |
Sprite (Sprite other) | |
Sprite (Texture2D texture, Rectangle? sourceRectangle, Vector2? newOffset, float newRotation=0.0f, string path=null) | |
async Task | LazyLoadAsync () |
void | EnsureLazyLoaded (bool isAsync=false) |
void | ReloadTexture () |
void | Draw (ISpriteBatch spriteBatch, Vector2 pos, float rotate=0.0f, float scale=1.0f, SpriteEffects spriteEffect=SpriteEffects.None) |
void | Draw (ISpriteBatch spriteBatch, Vector2 pos, Color color, float rotate=0.0f, float scale=1.0f, SpriteEffects spriteEffect=SpriteEffects.None, float? depth=null) |
void | Draw (ISpriteBatch spriteBatch, Vector2 pos, Color color, Vector2 origin, float rotate=0.0f, float scale=1.0f, SpriteEffects spriteEffect=SpriteEffects.None, float? depth=null) |
virtual void | Draw (ISpriteBatch spriteBatch, Vector2 pos, Color color, Vector2 origin, float rotate, Vector2 scale, SpriteEffects spriteEffect=SpriteEffects.None, float? depth=null) |
void | DrawSilhouette (SpriteBatch spriteBatch, Vector2 pos, Vector2 origin, float rotate, Vector2 scale, SpriteEffects spriteEffect=SpriteEffects.None, float? depth=null) |
Creates a silhouette for the sprite (or outline if the sprite is rendered on top of it) More... | |
void | DrawTiled (ISpriteBatch spriteBatch, Vector2 position, Vector2 targetSize, float rotation=0f, Vector2? origin=null, Color? color=null, Vector2? startOffset=null, Vector2? textureScale=null, float? depth=null, SpriteEffects? spriteEffects=null) |
Static Public Member Functions | |
static Identifier | GetIdentifier (XElement sourceElement) |
Creates a supposedly unique identifier from the parent element. If the parent element is not found, uses the sprite element. TODO: If there are multiple elements with exactly the same data, the ids will fail. -> Is there a better way to identify the sprites? ALSO TODO: delete :) More... | |
static Texture2D | LoadTexture (string file, bool compress=true, ContentPackage contentPackage=null) |
Public Attributes | |
Vector2 | size = Vector2.One |
float | rotation |
SpriteEffects | effects = SpriteEffects.None |
Static Public Attributes | |
static readonly Version | LastBrokenTiledSpriteGameVersion = new Version(major: 1, minor: 2, build: 7, revision: 0) |
Last version of the game that had broken handling of sprites that were scaled, flipped and offset More... | |
Protected Attributes | |
Vector2 | offset |
Vector2 | origin |
float | depth |
volatile bool | loadingAsync = false |
Properties | |
ContentXElement | SourceElement [get] |
Reference to the xml element from where the sprite was created. Can be null if the sprite was not defined in xml! More... | |
bool | LazyLoad [get] |
Rectangle | SourceRect [get, set] |
float | Depth [get, set] |
Vector2 | Origin [get, set] |
In pixels More... | |
Vector2 | RelativeOrigin [get, set] |
0 - 1 More... | |
Vector2 | RelativeSize [get] |
ContentPath | FilePath [get] |
string | FullPath [get] |
bool | Compress [get] |
Identifier | EntityIdentifier [get, set] |
Identifier of the Map Entity so that we can link the sprite to its owner. More... | |
string | Name [get, set] |
Identifier | Identifier [get] |
static IEnumerable< Sprite > | LoadedSprites [get] |
Texture2D | texture [get] |
Texture2D | Texture [get] |
bool | Loaded [get] |
Definition at line 13 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
Barotrauma.Sprite.Sprite | ( | ContentXElement | element, |
string | path = "" , |
||
string | file = "" , |
||
bool | lazyLoad = false |
||
) |
Definition at line 110 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
Barotrauma.Sprite.Sprite | ( | string | newFile, |
Vector2 | newOrigin | ||
) |
Definition at line 165 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
Barotrauma.Sprite.Sprite | ( | string | newFile, |
Rectangle? | sourceRectangle, | ||
Vector2? | origin = null , |
||
float | rotation = 0 |
||
) |
Definition at line 171 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
Barotrauma.Sprite.Sprite | ( | Sprite | other | ) |
Definition at line 81 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
Barotrauma.Sprite.Sprite | ( | Texture2D | texture, |
Rectangle? | sourceRectangle, | ||
Vector2? | newOffset, | ||
float | newRotation = 0.0f , |
||
string | path = null |
||
) |
Definition at line 88 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
void Barotrauma.Sprite.Draw | ( | ISpriteBatch | spriteBatch, |
Vector2 | pos, | ||
Color | color, | ||
float | rotate = 0.0f , |
||
float | scale = 1.0f , |
||
SpriteEffects | spriteEffect = SpriteEffects.None , |
||
float? | depth = null |
||
) |
Definition at line 255 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
|
virtual |
Reimplemented in Barotrauma.SpriteSheet.
Definition at line 265 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
void Barotrauma.Sprite.Draw | ( | ISpriteBatch | spriteBatch, |
Vector2 | pos, | ||
Color | color, | ||
Vector2 | origin, | ||
float | rotate = 0.0f , |
||
float | scale = 1.0f , |
||
SpriteEffects | spriteEffect = SpriteEffects.None , |
||
float? | depth = null |
||
) |
Definition at line 260 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
void Barotrauma.Sprite.Draw | ( | ISpriteBatch | spriteBatch, |
Vector2 | pos, | ||
float | rotate = 0.0f , |
||
float | scale = 1.0f , |
||
SpriteEffects | spriteEffect = SpriteEffects.None |
||
) |
Definition at line 250 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
void Barotrauma.Sprite.DrawSilhouette | ( | SpriteBatch | spriteBatch, |
Vector2 | pos, | ||
Vector2 | origin, | ||
float | rotate, | ||
Vector2 | scale, | ||
SpriteEffects | spriteEffect = SpriteEffects.None , |
||
float? | depth = null |
||
) |
Creates a silhouette for the sprite (or outline if the sprite is rendered on top of it)
Definition at line 275 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
void Barotrauma.Sprite.DrawTiled | ( | ISpriteBatch | spriteBatch, |
Vector2 | position, | ||
Vector2 | targetSize, | ||
float | rotation = 0f , |
||
Vector2? | origin = null , |
||
Color? | color = null , |
||
Vector2? | startOffset = null , |
||
Vector2? | textureScale = null , |
||
float? | depth = null , |
||
SpriteEffects? | spriteEffects = null |
||
) |
Definition at line 292 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
void Barotrauma.Sprite.EnsureLazyLoaded | ( | bool | isAsync = false | ) |
Definition at line 133 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
|
static |
Creates a supposedly unique identifier from the parent element. If the parent element is not found, uses the sprite element. TODO: If there are multiple elements with exactly the same data, the ids will fail. -> Is there a better way to identify the sprites? ALSO TODO: delete :)
Definition at line 206 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
async Task Barotrauma.Sprite.LazyLoadAsync | ( | ) |
Definition at line 126 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
|
static |
Definition at line 198 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
bool Barotrauma.Sprite.ParseTexturePath | ( | string | path = "" , |
string | file = "" |
||
) |
Definition at line 291 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
void Barotrauma.Sprite.ReloadTexture | ( | ) |
Definition at line 169 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
void Barotrauma.Sprite.ReloadXML | ( | ) |
Works only if there is a name attribute defined for the sprite. For items and structures, the entity id or name is used if the sprite's name attribute is not defined.
Definition at line 231 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
void Barotrauma.Sprite.Remove | ( | ) |
Definition at line 215 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
override string Barotrauma.Sprite.ToString | ( | ) |
Definition at line 93 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
protected |
Definition at line 44 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
SpriteEffects Barotrauma.Sprite.effects = SpriteEffects.None |
Definition at line 41 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
static |
Last version of the game that had broken handling of sprites that were scaled, flipped and offset
Definition at line 290 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
|
protected |
Definition at line 62 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
|
protected |
Definition at line 24 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
protected |
Definition at line 32 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
float Barotrauma.Sprite.rotation |
Definition at line 38 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
Vector2 Barotrauma.Sprite.size = Vector2.One |
Definition at line 36 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
get |
Definition at line 91 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
getset |
Definition at line 52 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
getset |
Identifier of the Map Entity so that we can link the sprite to its owner.
Definition at line 101 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
get |
Definition at line 87 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
get |
Definition at line 89 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
get |
Definition at line 13 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
|
get |
Definition at line 26 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
get |
Definition at line 76 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
|
staticget |
Definition at line 14 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
|
getset |
Definition at line 102 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
getset |
In pixels
Definition at line 61 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
getset |
0 - 1
Definition at line 75 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
get |
Definition at line 85 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
get |
Reference to the xml element from where the sprite was created. Can be null if the sprite was not defined in xml!
Definition at line 18 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
getset |
Definition at line 46 of file BarotraumaShared/SharedSource/Sprite/Sprite.cs.
|
getprotected |
Definition at line 64 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.
|
get |
Definition at line 65 of file BarotraumaClient/ClientSource/Sprite/Sprite.cs.