Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Jose on February 25, 2011, 11:45:43 PM

Title: Tiled image opacity problem
Post by: Jose on February 25, 2011, 11:45:43 PM
Hi,

I've made a very simple image to use as background (as tiled image) for a window. The background is a black filled rectangle (400x15) with an 45% opacity. The problem is that when I use this image in the tiled image editor the color isn't solid, the image appears whith a gradient in the bottom so when you use this tiled image in a window, let's say 400x30 for example, the window looks like a blind due to the gradient. Can anyone help me with this issue?

Thanks in advance.
Title: Re: Tiled image opacity problem
Post by: Mnemonic on February 26, 2011, 09:18:02 AM
Can you post the image and the tiled image definition?
Title: Re: Tiled image opacity problem
Post by: Jose on February 26, 2011, 11:39:02 AM
Hi Mnemonic,

you can find both files here http://www.mediafire.com/?9c9cikohmecqmgv (http://www.mediafire.com/?9c9cikohmecqmgv)

Thanks a lot for your help.
Title: Re: Tiled image opacity problem
Post by: Mnemonic on February 26, 2011, 01:37:19 PM
Is there any reason for using such... weird dimensions for the image? You should actually try to limit the number of the resulting tiles, because each tile means two extra polygons to render. And making the middle tile 2 pixels wide is asking for performance troubles.

That said, I'm not sure why we're seeing the artifact we're seeing, but I'm pretty sure you can fix it by making the image like 30x30 pixels. Since it's a simple semi-transparent rectangle, that shouldn't make a difference.
Title: Re: Tiled image opacity problem
Post by: Jose on February 26, 2011, 02:48:52 PM
Hi Mnemonic,

yesterday I was testing with differents heights and I noticed that the problems occurs with any height less than arround 50 pixels, anyway I'll try it again and tell you something. Usually, the textbox only contains one line of text so I don't need more than 15 pixels height that's what I made the background so small.

Thanks for your support  :)
Title: Re: Tiled image opacity problem
Post by: Mnemonic on February 26, 2011, 02:58:35 PM
If you expect oblong shapes, I recommend making the border thin, and the middle part bigger (the border part is only used twice, while the middle part can be potentially repeated many times).
Title: Re: Tiled image opacity problem
Post by: Jose on February 27, 2011, 01:44:48 PM
Yes Mnemonic I knew it and I'll keep it in mind for the future. One more question, is there any possibility to set the vertical alignment of an entity subtitles just as in the case of a static control?

Thanks in advance.
Title: Re: Tiled image opacity problem
Post by: Mnemonic on February 28, 2011, 12:06:27 PM
EDIT: I was wrong. If you look at the Talk method in the documentation, you'll see there's a parameter which sets subtitle alignment.
Title: Re: Tiled image opacity problem
Post by: Jose on February 28, 2011, 01:29:55 PM
Yes Mnemonic I've read that in the documentation but I thought that it was only for the horizontal alignment 'cause the values it can take (0-left, 1-right, 2-center). Is it valid for the vertical alignment too?

Thanks in advance
Title: Re: Tiled image opacity problem
Post by: Mnemonic on February 28, 2011, 09:14:25 PM
Ah, *vertical*, sorry. No, there's no vertical alignment for subtitles.
Title: Re: Tiled image opacity problem
Post by: Jose on February 28, 2011, 10:14:14 PM
OK, don't worry I've solved it with a static control.

Thanks for your support!