What do these functions do?

Started by PSL, May 18, 2024, 06:30 AM

Previous topic - Next topic

PSL

Function MoveForward()
Return type: void.
Moves the siblign element right in front of this one behind it.

Function MoveBackward()
Return type: void.
Moves the sibling element right behind this element to the front of it.

Function SendToTop()
Return type: void.
Moves this element on top of all other sibling elements.

Function SendToBottom()
Return type: void.
Moves this element to the bottom of all other sibling elements.

I tried to set up these functions for the GUI, the result is nothing changed, look at the meaning of this function can not understand, can anyone explain, thank you very much.

Sebastian

Maybe they are related to the "Z coords of screen".
Like, when you have 3 sprites one over the other, and call the SendToTop it will be displayed as the first one on screen, in front of the others.
Maybe same thing goes for MoveForward: moves it in front of the next one.

It's just a guess though, but if u test and find it out, would be cool to know.

PSL

This is my research code, I create a canvas and text, the default text is divided on the canvas, when I change the color of the canvas, the canvas comes over the text and it's blocked, I want the text to appear on top of the canvas I change the color, but after using these functions, nothing happens, okay.
function Script::ScriptLoad()
{
myCanvas<-GUICanvas();
myCanvas.Position=VectorScreen(0,0);
myCanvas.Size=VectorScreen(200,200);
myCanvas.Colour=Colour(45,45,45,100);

mylabel<-GUILabel();
mylabel.Text="Text Label";
mylabel.TextColour=Colour(255,255,255,255);
mylabel.FontSize=50;
mylabel.Pos=VectorScreen(0,0);

myCanvas.AddChild(mylabel);
}

function ChangeColour()
{
myCanvas.Colour=Colour(0,150,0,100);
mylabel.SendToTop();
}