Theme.txt Syntax

Started by crdl_pls, 28 February 2016, 00:38:54

crdl_pls

Sorry for all the questions, I really appreciate your help.

I'm trying to figure out the syntax of the Black.txt file included in the download so I can make my own from premade textures. I can't seem to find a description on either the forum or the main site. I assumed that the brackets with 4 values were (top,left,width,height) but that doesn't appear to work.

Also is it possible to do something like this:
Button {
    NormalImage     : "ThemeNormalImage.png" Part(whatever) Middle(whatever);
    HoverImage      : "ThemeHoverImage.png" Part(whatever) Middle(whatever);
    DownImage       : "ThemeDownImage.png" Part(whatever) Middle(whatever);


so that I could load every individual texture from its own file? Granted not safe efficient but I have them split up as it is.

texus

#1
I wanted to write a tutorial about it because someone else asked for an explanation too, but eventually I discovered a bug while doing so and I spend the time that I had with fixing it and finishing the tests for the Texture class instead of actually writing the tutorial.
Writing a tutorial is a boring task anyway so I'm not really motivated to write it during these few hours a week that I have some spare time now.

The values are (LEFT, TOP, width, height) but for the Middle rect it should be noted that it is relative to the Part rect (if Part rect is given).

The Part and Middle rect are both optional, to load the image from a separate file, just write the following:
Code (css) Select
NormalImage : "ThemeNormalImage.png";

crdl_pls

Quote from: texus on 28 February 2016, 09:17:45
The values are (LEFT, TOP, width, height) but for the Middle rect it should be noted that it is relative to the Part rect (if Part rect is given).
That's what I meant, thanks :)

Quote from: texus on 28 February 2016, 09:17:45
The Part and Middle rect are both optional, to load the image from a separate file, just write the following:
Code (css) Select
NormalImage : "ThemeNormalImage.png";
Amazing, that'll really speed things up for me. Thanks for the help.