Page 2 of 2

Re: How to Zoom in/out group content

Posted: Wed Jul 03, 2013 9:31 pm
by palanolho
Greetings Bernd,

Sorry for the delay, but have had some later work on my job and some other stuffs got in the way and so, I was not able to reply faster. My apologies.

I have been looking to it and it looks like what I needed.

I'll try to add the modifications to my script and see how it works (and if I can make it work lol ) and I'll let you know

Many thanks for your time

Kind regards,
- Miguel

Re: How to Zoom in/out group content

Posted: Thu May 15, 2014 3:12 pm
by jalz
Hi Bernd

Just wanted to thank you for posting/sharing this stack, its something I was contemplating adding to my print preview screen. I'll try and dissect it and see if I can understand it.

All the best
Jalz

Re: How to Zoom in/out group content

Posted: Thu May 15, 2014 5:45 pm
by bn
Hi jalz,

feel free to ask if you get stuck. This is tricky stuff. As Miguel and I found out.

You might also have a look at this thread

http://forums.runrev.com/phpBB2/viewtop ... =8&t=19493

which is basically the same topic.

Kind regards
Bernd

Re: How to Zoom in/out group content

Posted: Mon Jul 21, 2014 10:49 am
by jalz
Hi Bernd,

I have a quick question on this if you dont mind?
How did you work out the MesDim values from. If I select 100% and select the red box, the custom property MesDim is 893,174,1178,448 - however if I select the size and position pane I get the values 852, 196 1137, 470. Is there a trick I am missing?

The uLocationAt100Percent property has the same figures as in the sizebox.


Thanks
Jalz

Re: How to Zoom in/out group content

Posted: Mon Jul 21, 2014 11:09 am
by bn
Hi Jalz,

MesDim and uLocationAt100Percent are customproperties of every object in the group you want to zoom. They are set when you configure your zoom-group and the objects are at 100 percent size and at 100 percent location. This is what the button "setLoc of objects" at the lower left is for: you place all objects at 100 percent size to the location you want them at 100 percent size and press the button. You do that only once. Unless you want to change the location or size of objects you should not click the button again sine it would record wrong dimensions and locations if the zoom is not at 100 percent.

I hope this is what you are seeing.

Kind regards
Bernd

Re: How to Zoom in/out group content

Posted: Mon Jul 21, 2014 5:03 pm
by bn
Hi Jalz,

sorry for the confusion I created in previous post. I replied without actually looking at the code.

I see the same as what you describe: in main_App4 the rect of objects at 100 percent is not what the customProperty MesDim contains.

To change that you can change the script of button "setloc of objcts" and replace the repeat loop in handler setLocsOfGroupMembersAsCustomProperties with this:

Code: Select all

repeat with i = 1 to nrElems
          put line i of  eList into tControl
          set the uLocationAt100Percent of control tControl to the loc of control tControl
          set the mesDim of control tControl to the rect of control tControl -- added BN
     end repeat 
new line commented -- added BN

apart from not using the correct scaling the functionality of the zooming was not affected, now if you have placed your objects in "group game_content_area" at 100% at zoom level 100% they should scale correctly.

If you have any more problems with this feel free to ask here or to pm me (private mail via forum)

Kind regards
Bernd

Re: How to Zoom in/out group content

Posted: Tue Jul 22, 2014 12:31 pm
by jmburnod
Salut Bernd,

I played with main_app4.
It works fine for me.
I just add some lines for fields in a main_app5 version
Changed can be found with this comment

Code: Select all

for fields added jmb 
Kind regards
Jean-Marc

Re: How to Zoom in/out group content

Posted: Tue Jul 22, 2014 2:04 pm
by bn
Salut Jean-Marc,

I just did essentially the same for Jalz. He wanted to have text fields. The only difference is when setting the custom property I use the "effective textSize" in case a user drops just a standard field into the group without specifying the textSize. Then "textSize" without "effective" returns empty because the field uses the textSize of an object higher in the hierarchy like card stack or group.

And I don't set the textHeight because it automatically adjusts automatically.

Kind regards

Bernd