About Store Forum Documentation Contact



Post Reply 
Set new GUI Styles.
Author Message
Salival Offline
Member

Post: #1
Set new GUI Styles.
Hello, I have had much trouble to bring their own styles for my GUI windows. I want to put them through code, so I have done this.

Example.

Code:
class CWinSample
{
public:
    CWinSample();
    ~CWinSample();

    GuiStyle WinStyle;
    Window  WinObj;
};

Inside CWinSample::Initialize
---------------------------

// window
Gui += WinObj.create(Rect_LU(D.w()-winSize.x,-D.h()+winSize.y, winSize.x, winSize.y)).level(0);

// Style
WinStyle.image_back = Images("../data/Textures/GUI/Inventory/WinSample.gfx");
WinStyle.border_color.set(0,0,0,0);
WinStyle.blur_color.set(0,0,0,0);
WinStyle.shadow = 0;

// Window Settings
WinObj.barVisible( false );
WinObj.style = &WinStyle;

Is this wrong way to set new GUI Styles for windows?

I need help with this.

Esenthel, Show me a perfect way to set new GUI Styles for windows.

Thank you!
(This post was last modified: 06-21-2010 12:55 PM by Salival.)
06-21-2010 12:55 PM
Find all posts by this user Quote this message in a reply
Salival Offline
Member

Post: #2
RE: Set new GUI Styles.
I never get a clear answer on this question, Does anyone have any clue how to set the styles in Code? or does everyone use the editor?

For me the abow code does not work, The style do not get set.

Thank you
(This post was last modified: 06-22-2010 06:53 AM by Salival.)
06-22-2010 06:52 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #3
RE: Set new GUI Styles.
its ok but you somehow pasted not all sources, youre using undescribed Initialize method
06-22-2010 09:01 AM
Find all posts by this user Quote this message in a reply
Salival Offline
Member

Post: #4
RE: Set new GUI Styles.
(06-22-2010 09:01 AM)Esenthel Wrote:  its ok but you somehow pasted not all sources, youre using undescribed Initialize method

It's not ok, Did you even try it? Because it does not work if I set the GUI Styles by code that way, Thats why I ask, And please help :/

When I set gui styles like this, They get none at all.

class CWinSample
{
public:
CWinSample();
~CWinSample();

void Initialize();

GuiStyle WinStyle;
Window WinObj;
};

Code:
void CWinSample::Initialize()
{

// window
Gui += WinObj.create(Rect_LU(D.w()-winSize.x,-D.h()+winSize.y, winSize.x, winSize.y)).level(0);

// Style
WinStyle.image_back = Images("../data/Textures/GUI/Inventory/WinSample.gfx");
WinStyle.border_color.set(0,0,0,0);
WinStyle.blur_color.set(0,0,0,0);
WinStyle.shadow = 0;

// Window Settings
WinObj.barVisible( false );
WinObj.style = &WinStyle;

}
(This post was last modified: 06-22-2010 03:14 PM by Salival.)
06-22-2010 03:13 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
RE: Set new GUI Styles.
what about
WinStyle.back_color=WHITE;
WinStyle.back_scale=1;
06-22-2010 03:37 PM
Find all posts by this user Quote this message in a reply
Salival Offline
Member

Post: #6
RE: Set new GUI Styles.
(06-22-2010 03:37 PM)Esenthel Wrote:  what about
WinStyle.back_color=WHITE;
WinStyle.back_scale=1;

Oh yes that worked, Now it shows.

I used the back_fit=true instead of back_scale=1 and it works great.

Thanks.
(This post was last modified: 06-22-2010 08:10 PM by Salival.)
06-22-2010 08:09 PM
Find all posts by this user Quote this message in a reply
Post Reply