RESIZING

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

RESIZING

Postby GORDON » Tue Dec 01, 2009 3:48 pm

I've just resized my frames from 800x600 to 1024x768. Is there an easier way to have the hotspots that were set for the 800x600 frames match up with the resized 1024x768 frames without moving them all manually?
Thanks!
GORDON
Advanced Member
 
Posts: 154
Joined: Mon Apr 30, 2007 1:36 am
Location: Canada

Postby reneuend » Tue Dec 01, 2009 8:23 pm

I think you can use the Project Properties and add some code to move all your hotspots a certain amount at the start of each frame opening. It sure seems feasible, I just haven't done it.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Lyberodoggy » Wed Dec 02, 2009 2:51 pm

Yeah, that's actually a great Idea!
You can define the new position by using this code:

Code: Select all
For each H in hotspot
H.left=npw*H.left/opw
H.top=nph*H.top/oph
H.width=npw*H.width/opw
H.height=nph*H.height/oph
next

In the "Execute some vbs each time a frame is loaded" project property
Change npw, opw, nph, oph with the new project width, old project width, new project height, old project hight respectively, given in pixels.
For example changing from 800*600 to 1024*768 should be done with this code:

Code: Select all
For each H in hotspot
H.left=1024*H.left/800
H.top=768*H.top/600
H.width=1024*H.width/800
H.height=768*H.height/600
next
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby ShadowHunter » Wed Dec 02, 2009 3:17 pm

Perhaps you can extented this code to include textboxes and other controls too, I think it would be useful :wink:

Good job Liberodoggy
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Lyberodoggy » Wed Dec 02, 2009 4:29 pm

Yeah you can apply the same technique. Just then, you have to get the code executed after the frame has finished loading (to resize the controls after they have been initialized).
You can use the same code, changing the first line (for each H in Hotspot) with the control you wanna change
i.e. for the text controls of a frame, you can use

Code: Select all
For each T in text
H.left=npw*T.left/opw
H.top=nph*T.top/oph
H.width=npw*T.width/opw
H.height=nph*T.height/oph
next
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby reneuend » Wed Dec 02, 2009 4:33 pm

Nice code Lyberodoggy! It's more efficient then I had imagined! :-)
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Lyberodoggy » Wed Dec 02, 2009 4:36 pm

Thanks guys :D
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests