Salival
Member
|
GUI Question.
I have some questions about this GUI Interface.
1) Set correct back_image style for each window?
First I load the image_back for the login window.
LoginWindow.style->image_back = Images("../data/Textures/GUI/Login/LoginWindow.gfx");
Then I load lets say a inventory window.
InventoryWindow.style->image_back = Images("../data/Textures/GUI/Inventory/InventoryWindow.gfx");
Now both login window and Inventory window got the inventory image_back :/. But they should have its own image_back style.
2) Quality for 2D Images.
I must say that the 2D Images looks very bad sometimes, Like you can't move windows around, If you move them the image itself will be blured and not as sharp, Is this because you are't using pixel movement? And how can I draw everything pixel based? I want my Interface to look as sharp like on the image.
|
|
05-24-2010 10:31 AM |
|
Esenthel
Administrator
|
RE: GUI Question.
1) GuiStyle style[2];
|
|
05-24-2010 11:26 AM |
|
Salival
Member
|
RE: GUI Question.
(05-24-2010 11:26 AM)Esenthel Wrote: 1) GuiStyle style[2];
But if I make a new window class, it will have its own style class?. Or is this style class for all objects?
Like Window LoginWindow; This one will have its own GuiStyle pointer. If I set style to this pointer will it effect only this window ? or all ?
What about my second question, About the image quality, It really makes the interface looks bad if it is blured and not as sharp.
So I must setup the GUI styles like this.
LoginWindow.style[0].image_back = Images("../data/Textures/GUI/Login/LoginWindow.gfx");
InventoryWindow.style[1].image_back = Images("../data/Textures/GUI/Inventory/InventoryWindow.gfx");
?
(This post was last modified: 05-24-2010 12:29 PM by Salival.)
|
|
05-24-2010 12:07 PM |
|
Salival
Member
|
RE: GUI Question.
Let me remake the question, How can I set own gui style for each gui object?
Like ?
GuiStyle pInfoStyle;
pInfoStyle.border_color = GREEN;
pInfoStyle.back_color.set(0,0,0,0);
pInfoStyle.shadow = 0;
Window infoWindow;
infoWindow.style = &pInfoStyle;
Or how would you make it?
(This post was last modified: 05-24-2010 08:56 PM by Salival.)
|
|
05-24-2010 01:59 PM |
|
Esenthel
Administrator
|
RE: GUI Question.
yes, this code is good.
you can always prepare GuiStyle in GuiEditor and then just set window.style=GuiStyles("....");
about blurring - you'd need to manually align objects (or just parent) to per-pixel coordinates.
|
|
05-25-2010 10:30 AM |
|
Salival
Member
|
RE: GUI Question.
(05-25-2010 10:30 AM)Esenthel Wrote: yes, this code is good.
you can always prepare GuiStyle in GuiEditor and then just set window.style=GuiStyles("....");
about blurring - you'd need to manually align objects (or just parent) to per-pixel coordinates.
Ok I will try it out.
Can you give some sample how to manually align objects to per-pixel coordinates, It should be really great.
Thanks!
I tested to set new GUI Style to objects like this.
GuiStyle pInfoStyle;
pInfoStyle.border_color = GREEN;
pInfoStyle.back_color.set(0,0,0,0);
pInfoStyle.shadow = 0;
Window infoWindow;
infoWindow.style = &pInfoStyle;
But then it crashes on the Gui.draw method.
Any ideas?
(This post was last modified: 05-25-2010 05:16 PM by Salival.)
|
|
05-25-2010 04:38 PM |
|
Esenthel
Administrator
|
RE: GUI Question.
gui style must be in constant memory address (possibly you're declaring in local space, in method for example)
you should use D.screenTo, pixelTo for aligning position to per-pixel
|
|
05-25-2010 08:26 PM |
|