About Store Forum Documentation Contact



Post Reply 
Image tabs
Author Message
AndrewBGS Offline
Member

Post: #1
Image tabs
I was wondering if there isn't a way to have the tabs functionality but instead of plain text have images.
Like in the case of buttons, we can just have an image t be treated as a button. Couldn't the same be done with tabs? You know players would appreciate icons a lot more than text; and the built-in tabs functionality is great, I wouldn't just throw it away to build my image tabs manually.
05-14-2013 09:26 AM
Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #2
RE: Image tabs
As i guess you are referring to Gui::Tabs then i have some suggestions to make.

Code:
REPA(MyTabs.tab){
     MyTabs.tab.image="The image";
     //or do something tricky as leaving the image path with an ending *then name as name
     Memc<Str> splite = Split (MyTabs.tab(i),'*');
     MyTabs.tab(i).image=splite[0];
     MyTabs.tab(i).set(splite[1]);

     //In the editor i set name to Gfx/Tabs/Coin.gfx*Coins
}
Those two examples might work to fix a bg of your tabs image instead of default btn.
Another example is to replace Tab class using TabsImage; TabsImage has an extra image; you could use this as instead of text/name i think.

Good luck, hope i am thinking about the same as you.
(This post was last modified: 05-14-2013 10:30 AM by TBJokers.)
05-14-2013 10:03 AM
Visit this user's website Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #3
RE: Image tabs
Lovely, it worked smile Just got around to trying it now, but it's just what I wanted, thank a lot!
05-22-2013 08:48 AM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #4
RE: Image tabs
Also try
TabsImage instead of Tabs.

TabsImage.image(i, ImagePtr);
(This post was last modified: 05-22-2013 09:42 AM by SamNainocard.)
05-22-2013 09:41 AM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #5
RE: Image tabs
I figured out that using TabsImage draws the image above the tab and that it's not affected when activated (color doesn't change etc).

I got my tabs working by simply doing this:
Code:
Tabs tabs;
/*creating tab 0,1,2 etc*/

tabs.tab(0).image = "directory/name.gfx";

The image is drawn and working as a tab should, but idk why it's being turned upside down when activated. So for example - I used a .gfx file with a text on it and when the tab with that image gets activated, the image is turned upside down :|
05-22-2013 08:07 PM
Find all posts by this user Quote this message in a reply
Fex Offline
Gold Supporter

Post: #6
RE: Image tabs
(05-22-2013 08:07 PM)Kiekos Wrote:  I figured out that using TabsImage draws the image above the tab and that it's not affected when activated (color doesn't change etc).

I got my tabs working by simply doing this:
Code:
Tabs tabs;
/*creating tab 0,1,2 etc*/

tabs.tab(0).image = "directory/name.gfx";

The image is drawn and working as a tab should, but idk why it's being turned upside down when activated. So for example - I used a .gfx file with a text on it and when the tab with that image gets activated, the image is turned upside down :|

Try this to stop the image turning upside down:

tabs.tab(0).draw_mode = BUTTON_DRAW_IMAGE;
05-22-2013 08:26 PM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #7
RE: Image tabs
Aaaaaand done. Thanks!
05-22-2013 08:33 PM
Find all posts by this user Quote this message in a reply
Scarlet Thread Offline
Member

Post: #8
RE: Image tabs
It would be nice if we could change this image in the Gui Editor as well for those Fixed GUI's. It seems kinda silly to load this whole GUI with custom images and then having to set the images for each tab in the code.
05-28-2013 09:30 AM
Find all posts by this user Quote this message in a reply
Post Reply