Wintermute Engine => Technical forum => Topic started by: anarchist on May 19, 2012, 11:37:30 PM
Title: Help with tiled images
Post by: anarchist on May 19, 2012, 11:37:30 PM
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:
Code: WME Script
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)).
Code: WME Script
var textBox = commentWindow.GetControl("commentText");
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:
Title: Re: Help with tiled images
Post by: anarchist on May 20, 2012, 01:12:46 PM
Thank you Mnemonic! Works like a charm :) So if I get it right, the static control was empty at the bottom because the tile needs a space of 50pixels to fill?
Title: Re: Help with tiled images
Post by: Mnemonic on May 20, 2012, 07:50:15 PM
Depends. If you don't resize the window, your label will be partially outside the window bounds. If the window's ClipChildren property is set to true, the outside part will be cut.
Title: Re: Help with tiled images
Post by: anarchist on May 21, 2012, 04:48:03 PM
Thanks again mnemonic you have been very helpful ::thumbup