Documentation: SpriteComponent
Jump to navigation
Jump to search
Name | Type | Initial Value | Example Range | Description |
---|---|---|---|---|
Members | ||||
image_file | std::string | data/temp/temp_gun.png | ||
ui_is_parent | bool | false | Adds this to the GG.GetUISprite() as a child, instead of the mSpriteContainer | |
is_text_sprite | bool | false | if you want to load a text sprite, set this to true and image_file to a font file | |
offset_x | float | 0 | [-24, 24] | |
offset_y | float | 0 | [-24, 24] | |
alpha | float | 1 | ||
visible | bool | true | ||
emissive | bool | false | ||
additive | bool | false | ||
fog_of_war_hole | bool | false | if 1, the alpha channel of this texture punctures a hole in the fog of war | |
smooth_filtering | bool | false | ||
rect_animation | std::string | |||
next_rect_animation | std::string | |||
text | std::string | |||
z_index | float | 1 | [-256, 256] | 0 = world grid, -1 = enemies, -1.5 = items in world, player = 0.6 |
update_transform | bool | true | ||
update_transform_rotation | bool | true | ||
kill_entity_after_finished | bool | false | ||
has_special_scale | bool | false | if this is set, sets special_scale_x and _y to scale | |
special_scale_x | float | 1 | this overrides the scale of the entity, if has_special_scale | |
special_scale_y | float | 1 | this overrides the scale of the entity, if has_special_scale | |
never_ragdollify_on_death | bool | false | ||
Custom data types | ||||
transform_offset | vec2 | (0, 0) | ||
offset_animator_offset | vec2 | (0, 0) | used by SpriteOffsetAnimator | |
Privates | ||||
mSprite | as::Sprite* | |||
mRenderList | SpriteRenderList* | |||
mRenderListHandle | int32 | -1 |
Known Issues
Text Sprite Ragdoll
Text sprites on entities that have a ragdoll can cause crashes.
With most entities it's not a problem, for some it only happens occasionally (Kammolukki), meanwhile with other entities it's a guaranteed crash (Suomuhauki, Sauvojen tuntija).
Enabling the never_ragdollify_on_death
option can sometimes help prevent it from crashing.
Experimental Beta branch content. ⓘ
The information in this section is not yet part of the public release version, and might be incomplete.
This crash has been fixed on the beta branch.