Hello everyone,
I have just started working with tiled images in a window and have met some trouble.
I have a window of dimensions 150x150 which contains a static control of the exact same dimensions. I have created a .image file and have assigned it as the TiledImage of the static control (I have also tried assigning it to the window after I met trouble). The .image file looks like the following:
TILED_IMAGE
{
IMAGE="interface\window\windowBackground.png"
VERTICAL_TILES { 50, 50, 50 }
HORIZONTAL_TILES { 50, 50, 50 }
}
windowBackground.png is an image of dimensions 150x150 filled with a monochrome colour.
I want this to appear next to the actor and be filled with text. I want it to have fixed length and variable height to adjust to the amount of text. The code I use to show this window is the following (by calling Object.comment(text)).
var textBox = commentWindow.
GetControl("commentText");
method initialize(){
var height;
var width;
//place the window
else commentWindow.
X = actor.
X +
10;
else commentWindow.
Y = actor.
Y - actor.
Height;
}
////////////////////////////////////////////////////////////////////////////////
method comment(commentText)
{
textBox.
Text = commentText;
this.initialize();
}
The window successfully adjusts its height on the amount of text the static control contains. Unfortunately, the tiled image seems to not behave correctly. Sometimes it fills the window correctly but sometimes it is cut short at the bottom:
What causes such behaviour? Am I missing something regarding tiled images?
Thank you