Sie sind nicht angemeldet.

1

Montag, 14. Juni 2010, 12:20

area sizes and position

could be better if area have right bottom corner positon, then width and height set to auto. its like div margin *rolleyes*
this situation is more common
for example
area.left
area.top
area.right
area.bottom
area.width=auto - default
area.height=auto - default
if area.width or height is custom then right and bottom = auto (i have no idea about align)
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

2

Dienstag, 15. Juni 2010, 11:26

Hi,

thanks, good idea!

I think in this case a new area "mode" would be good,
e.g.
area.mode="border"
area.left="..."
area.top="..."
area.right="..."
area.bottom="..."

and let width/height alway be automatic in this mode,
I will add that to the next release

best regards,
Klaus

3

Dienstag, 15. Juni 2010, 16:54

That's great!

Thanks! *thumbsup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

4

Donnerstag, 17. Juni 2010, 14:31

HE Klaus,

that's what i mean with the area margins..

Tuur *thumbsup*

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

5

Donnerstag, 17. Juni 2010, 23:14

this would be possible with an action.

Quellcode

1
2
3
4
5
6
7
8
9
10
<events onresize="setMargin(10,10,10,10);" />
	<!-- setMargin(leftmargin,topmargin,bottommargin,rightmargin); -->
	<action name="setMargin">		
		<-- calculate remaining width. stagewidth - marginleft - marginright = area width -->
		sub(tmp1, stagewidth, %1); sub(tmp2, tmp1, %4); set(area.width, tmp2);
		<!-- calculate remaining height. stageheight - margintop - marginbottom = area height -->
		sub(tmp3, stageheight, %2); sub(tmp4, tmp3, %3); set(area.height, tmp4);
		<!--move the area-->
		set(area.x, %1); set(area.y, %2);
	</action>


the other away around would be possible to. Defining a fixed area size and the posistion it in the center no mather what resolution.

Quellcode

1
2
3
4
5
6
7
8
9
10
<events onresize="define_area_size(1008,571);" />

	<action name="define_area_size">
		div(halfstagewidth, stagewidth, 2); div(halfareawidth, %1, 2); sub(dest_area_x, halfstagewidth, halfareawidth);
		copy(area.x, dest_area_x);
		div(halfstageheight, stageheight, 2); div(halfareaheight, %2, 2); sub(dest_area_y, halfstageheight, halfareaheight);
		copy(area.y, dest_area_y);
		set(area.width, %1);
		set(area.height, %2);
	</action>


sorry if there's some faults in the code. it's late ;p

6

Freitag, 18. Juni 2010, 00:28

Hi Zephir *thumbup* ,

Zitat

sorry if there's some faults in the code. it's late ;p
You are right... it is late *smile* ;-) ...
set(area.width, tmp2); returns temp2
set(area.height, tmp4); returns temp4
Should be:
set(area.width, get(temp2));
or copy(area.width, tmp2);

Here the first code corrected:

Quellcode

1
2
3
4
5
6
7
8
9
10
	<events onresize="setMargin(10,10,10,10);" />
	<!-- setMargin(leftmargin,topmargin,bottommargin,rightmargin); -->	
	<action name="setMargin">	
		<!-- calculate remaining width. stagewidth - marginleft - marginright = area width -->
		sub(tmp1, stagewidth, %1); sub(tmp2, tmp1, %4); copy(area.width, tmp2);
		<!-- calculate remaining height. stageheight - margintop - marginbottom = area height -->
		sub(tmp3, stageheight, %2); sub(tmp4, tmp3, %3); copy(area.height, tmp4);
		<!--move the area-->
		set(area.x, %1); set(area.y, %2);
	</action>


Anyway, that's great... thanks to share *thumbup* ...

SAlut.

Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

Yomas

Fortgeschrittener

Beiträge: 190

Wohnort: Anglet, France

  • Nachricht senden

8

Donnerstag, 6. Oktober 2011, 21:58

Up please ^^

Hi all ^^
That's great !!
Would it be possible to add a fixed aspect ratio to this code part ? :

Quellcode

1
2
3
4
5
6
7
8
9
10
<events onresize="setMargin(10,10,10,10);" />
	<!-- setMargin(leftmargin,topmargin,bottommargin,rightmargin); -->	
	<action name="setMargin">	
		<!-- calculate remaining width. stagewidth - marginleft - marginright = area width -->
		sub(tmp1, stagewidth, %1); sub(tmp2, tmp1, %4); copy(area.width, tmp2);
		<!-- calculate remaining height. stageheight - margintop - marginbottom = area height -->
		sub(tmp3, stageheight, %2); sub(tmp4, tmp3, %3); copy(area.height, tmp4);
		<!--move the area-->
		set(area.x, %1); set(area.y, %2);
	</action>

Thanks in advance ^^
Best regards.
My website: www.eboovisite.com, See me also on www.Viewat.com, Facebook and Twitter

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

9

Donnerstag, 6. Oktober 2011, 23:24

It could be done, but you wouldnt have a fixed margin then. You would have maybe 100px black left and right, or 70px top and bottom, depending which resolution it would fit best.

let me think about it, my head is bit cloudy atm :P