Slick Forums

Discuss the Slick 2D Library
It is currently Wed Jun 19, 2013 3:53 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed May 18, 2011 5:40 am 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1188
The theme file format got a new feature:
<area xywh="10,10,16,8" rot="90"/>
This will rotate the area 90° clock wise.

The area can also be flipped on the horizontal or vertical axis by specifying a negative width or height:
<area xywh="10,10,-16,8" rot="90"/>

When the area has splitx or splity active then the split is applied on the unrotated area and the rotation is applied to the result.

This also works when the area has the tiled attribute set.

The theme editor also supports these (but they don't affect the image in the texture viewer - as this shows the source).
It can be easily tested by starting the demo mode, open the about page in the preview area (bottom center) and by editing parameters of the TWL logo.




Also new is a fallback theme which is used when the requested theme was not found. It can be used like this:
Code:
<theme name="-defaults">
   ...
   <theme name="" ref="*"/>  <!-- wildcard to allow flat themes (not a new feature) -->
</theme>

<theme name="*" ref="-defaults">
   <!-- this theme (name="*") is used when a requested theme was not found - it can of course reference any theme you want -->
   <param name="background"><image>error.404</image></param>
</theme>

The wild card reference in the "-defaults" theme allows to use all top level themes which are marked with allowWildcard="true" as implicit child themes everywhere (which is based on "-defaults").
Together with the new fallback theme this will allow that at least generic widgets like buttons and labels show up everywhere even if one of their parent widgets have a missing theme.

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2011 8:06 am 
Offline

Joined: Fri Sep 30, 2011 8:39 am
Posts: 17
Dear Matthias,

can this rotation be applied to text, too?

I want to design a button whose text is rotated by 90 degrees.
I have already defined the button with the rotation, but the text is still displayed horizontal.

Thank you
Tobias


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2011 5:10 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1188
No, the rotation applies only to image elements. Currently TWL doesn't support rotated text, and the current API is not really designed to handle that either :(

EDIT: Maybe if this applies only to a few buttons you could use an image instead of text?

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group