What purpose does Update have in Images? #1933
-
Hi, im currently implementing the UI for my game. What is the intended use for this, when would i like to use it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Any Currently, the |
Beta Was this translation helpful? Give feedback.
-
So its like a place that one can fill out if needed? That sounds useful, for like a shiny sprite animation when hoverd over a button. What if i have 100 buttons and 150 icons on the screen, do i have to implement them myself in order to avoid them being registerd somehow and recieve update "calls" ? ( it might be closer to 40 buttons and 90 icons in my case) |
Beta Was this translation helpful? Give feedback.
They are always "updated" by the UI system. You don't have to register or do anything at all. They are virtual methods you can override in derived classes if you think you need a derived specialized
ImageElement
. But unless that is your case, you can just useImageElement
and not override anything.The current implementation in there is prettly lightweight, just updates the sprite if it has changed (i.e. when you set / unset the sprite via the
Source
property). Take a look.