Slick Forums

Discuss the Slick 2D Library
It is currently Sat Dec 16, 2017 3:01 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Jun 18, 2013 4:44 pm 
Offline

Joined: Tue Oct 11, 2011 7:30 pm
Posts: 32
Hi

I'm trying to make a progress bar 1 or 2 pixels high (ultra thin).

In the layout of the main widget I am setting

Code:
    @Override
    protected void layout()
    {
        boxLayout.setSize(250,50);
        label.setMinSize(boxLayout.getInnerWidth(),(int)(boxLayout.getInnerHeight() * 0.9));
        progressBar.setMinSize(boxLayout.getInnerWidth(),1);
        progressBar.setMaxSize(boxLayout.getInnerWidth(),1);
       
    }


the progress bar here though refuses to go less than 10 pixels, in the theme xml there are no minimums or maximums set.

Any advice from anyone as to why this is happening and how I can fix it?

Is the texture size for progressing anything to do with it? (I am using the one from simple.xml)

Thanks

abcdef


Top
 Profile  
 
PostPosted: Tue Jun 18, 2013 5:32 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1242
First don't call setMinSize or setMaxSize - these are set via the theme.

The background image size affects the minimum size of a widget - you can use the size override attributes to change the reported size of an image in the theme.

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
PostPosted: Tue Jun 18, 2013 5:52 pm 
Offline

Joined: Tue Oct 11, 2011 7:30 pm
Posts: 32
Thanks, which attributes are these?


Top
 Profile  
 
PostPosted: Tue Jun 18, 2013 6:02 pm 
Offline

Joined: Tue Oct 11, 2011 7:30 pm
Posts: 32
quick thing, I set the max and min size because setSize doesn't work. The image from sample.xml has

Code:
<area name="-borderA" border="3" xywh="0,0,9,9" splitx="L3,R3" splity="T3,B3"/>


And I think it defaults automatically to 9, it won't stretch it to the size I want it.


Top
 Profile  
 
PostPosted: Tue Jun 18, 2013 8:57 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1242
Yes, that image has a size of 9 - but you can easily change it by setting sizeOverwriteV=1 - but it won't look nice as the corners/edges of a 9-way split are not stretched/scaled.

So for a thing progress bar you should consider using a single pixel image or a color gradient.

_________________
TWL - The Themable Widget Library


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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