Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: piere on April 08, 2012, 03:12:25 AM
-
Hello I am trying to scale windows and static objects but it is not working. For example, I am using this code on left click when I want to scale an image that is normally 100 length in X
image =this.GetWidget("image");
image.ScaleX = 50
I am also using this with windows it doesnt scale anything. Anyone know what to do?
-
try setting the scalable attribute to true first
-
I do, still nothing
-
Update: I feel that the ".Length" command is more of what I want that the ScaleX command, Howeer I cannot get this to work either. Ive done it on entities, static objects, and windows and nothing works... Anyone have any more tips?
-
UI objects have .Width and .Height properties.
-
I am also using this with windows it doesnt scale anything. Anyone know what to do?
You need to slightly modify sources of the game. For example, to enable ScaleX, ScaleY and AlphaColor parameters for Button objects you need to change HRESULT CUIButton::Display(int OffsetX, int OffsetY) method in UIButton.cpp
There you need to place
if(image) image->Draw(ImageX +((m_Press||m_OneTimePress)&&back?1:0), ImageY +((m_Press||m_OneTimePress)&&back?1:0), m_PixelPerfect?this:NULL, m_ScaleX, m_ScaleY, m_AlphaColor);
instead of
if(image) image->Draw(ImageX +((m_Press||m_OneTimePress)&&back?1:0), ImageY +((m_Press||m_OneTimePress)&&back?1:0), m_PixelPerfect?this:NULL);
Mnemonic, in this connection also I have a question for you. For what reason you cut off a functional of interface objects in comparison with other objects (entities) whereas they have the general ancestor and in principle can be more flexible.