2019-05-22 01:24 AM
Greetings
In my current project i need a way to change the whole project style, so for now i'm changing just the background. my default background is just a colored box, but if another style is selected i wanna set an image as background, and thats is done easily, but i can't figure out how to move the just created behind pre-existing objects. I saw that in the viewBase class the object order is just the order which they are created, no functions to set their order (as far as i know), so i can't create my image as background, because the viewbase class is called before my implemantation. A temporaly solution found was creating the image in the designer with no image set (or with .setVisible(false)), but i was hoping for a better solution.
Thanks for any suggestion.
Stefano
Solved! Go to Solution.
2019-06-13 06:22 AM
Hi @Zui,
Sorry i missed this!
Let me show you how to manipulate the z-order programatically.
void swapBoxForImage()
{
//remove all drawables
remove(mybackgroundBox);
remove(d1);
remove(d2);
add(myBackgroundImg);
add(d1);
add(d2);
}
2019-06-13 06:22 AM
Hi @Zui,
Sorry i missed this!
Let me show you how to manipulate the z-order programatically.
void swapBoxForImage()
{
//remove all drawables
remove(mybackgroundBox);
remove(d1);
remove(d2);
add(myBackgroundImg);
add(d1);
add(d2);
}
2019-06-13 01:07 PM
yeah, i figured that out by myself watching some touchGfx examples, but tnx anyway ;)
2019-06-13 04:10 PM
Okay, glad you could find it on your own :)