Search the Community
Showing results for tags 'WidgetSprite'.
-
WidgetSprite setTransform acting weirdly when width and hegiht are manually set.
mohamed.irshad.k posted a topic in UI Systems
When a WidgetSprite is rotated which has its size set manually by using setWidth() and setHeight() it gives unexpected result. If the size is set to (0, 0) then the rotation works as expected. Below is the sample code: WidgetSprite sprite; int init() { Gui gui = engine.getGui(); sprite = new WidgetSprite(gui,"samples/widgets/textures/background.png"); sprite.setPosition(400, 300); // Uncomment to see the problem. //sprite.setWidth(128); //sprite.setHeight(128); gui.addChild(sprite, GUI_ALIGN_OVERLAP); return 1; } float fAngle = 1.0f; int update() { sprite.setTransform(rotateZ(fAngle)); fAngle += 0.1; return 1; } int shutdown() { delete sprite; return 1; }- 9 replies
-
- WidgetSprite
- Sprite
-
(and 3 more)
Tagged with:
-
Hello. I have two ObjectGui on the scene. Both of them have WidgetSprite with callbacks: GUI_ENTER, GUI_LEAVE, GUI_PRESSED and GUI_RELEASED. So the problem: callbacks are firing when they should not. Sometimes when i click on one sprite, i see click on both sprites. Sometimes i just click somewhere in the world and one of sprites become clicked too. It is clearly seen in attached simple demo. I expect sprites to work like independent buttons with 3 states (normal, mouse over, pressed). sprite_callbacks.rar
- 1 reply
-
- WidgetSprite
- ObjectGui
-
(and 2 more)
Tagged with:
-
Hi all. I have widgetSprite. I added the layer. Using WidgetSprite::setLayerTransform I rotate it. sprite_env_but.setLayerTransform(1, rotateZ(30.0f*sl_environment.getValue())); But it takes a pivot point in the upper left corner. How to rotate around its center? Thanks.
- 2 replies
-
- widgetSprite
- transform layer
-
(and 2 more)
Tagged with:
-
Привет! Может кто создавал подобное. Я хочу в интерфейсе (загруженный через *.ui файл) создавать динамические GUI элементы. Пример: Есть диалоговое окно, на котором будет вопрос WidgetLabel, а ниже несколько вариантов ответов (WidgetButton или WidgetSprite) варианты с WidgetListBox и WidgetMenuBox не надо. Спасибо! ===================== translation from google ===================== Hello! Who can create similar. I want to interface (loaded via *. Ui file) to create dynamic GUI elements. Example: There is a dialog box that will question WidgetLabel, but below are a few answers (WidgetButton or WidgetSprite) options with WidgetListBox and WidgetMenuBox not. Thanks!
-
[SOLVED] WidgetSprite color changes on resolution change
mohamed.irshad.k posted a topic in Bug Reports
Below is the code for repro: Gui gui; WidgetSprite sprite; Image img1; int init() { gui = engine.getGui(); sprite = new WidgetSprite( gui ); gui.addChild( sprite ); img1 = new Image( "sprite_00.png" ); sprite.setImage( img1 ); sprite.setImage( img1 ); // IMPORTANT: This line is no mistake. return 1; } int shutdown() { return 1; } int update() { return 1; } Start the app in DirectX 9 mode ( not sure about others ) and then change the resolution using Unigine system menu. Notice sprite's color change.