turanszkij / WickedEngine

3D engine with modern graphics
https://wickedengine.net
Other
5.85k stars 618 forks source link

[Feature request] Add icon flipping #888

Closed AttackButton closed 4 months ago

AttackButton commented 4 months ago

Hi, I needed to flip one of the icons horizontally for an editor button, and I noticed that there is no such version available on the Font Awesome website. If it's possible to add the ability to rotate icons within Wicked Engine, that would be great.

turanszkij commented 4 months ago

You can rotate text with wi::font::FontParams::rotation (each gui widget has a SpriteFont and that has the params that can be modified). Flipping is not supported but it can be added.

AttackButton commented 4 months ago

Thanks, man. The icon was the default play button (a simple triangle) and rotating it by pi was enough. I will close this issue/request later.

Fixed

turanszkij commented 4 months ago

The tool tip overwriting could be because localization in the editor. Try creating the two buttons with different names (the widget's name is what you give in Create() function), then you can use SetText() on them to set the text they are drawing (your icon). I will add the flipping too, maybe it will be useful for other things.

AttackButton commented 4 months ago

Everything is working now. Thanks again.

turanszkij commented 4 months ago

Nice, I also added flipping to fonts, you can use font.params.enableFlipHorizontally() and enableFlipVertically(). I think this can be now closed.