Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Scale windows or static objects  (Read 3845 times)

0 Members and 1 Guest are viewing this topic.

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Scale windows or static objects
« 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?
Logged

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 196
    • View Profile
Re: Scale windows or static objects
« Reply #1 on: April 08, 2012, 11:46:04 AM »

try setting the scalable attribute to true first

Logged

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: Scale windows or static objects
« Reply #2 on: April 08, 2012, 09:22:58 PM »

I do, still nothing
Logged

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: Scale windows or static objects
« Reply #3 on: April 10, 2012, 04:24:19 AM »

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?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Scale windows or static objects
« Reply #4 on: April 10, 2012, 05:19:24 PM »

UI objects have .Width and .Height properties.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile
Re: Scale windows or static objects
« Reply #5 on: April 16, 2012, 03:10:58 PM »

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

Code: [Select]
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

Code: [Select]
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.
Logged
 

Page created in 0.225 seconds with 24 queries.