You are not logged in.

panoyun

Intermediate

  • "panoyun" started this thread

Posts: 234

Location: Somalia

  • Send private message

1

Tuesday, April 5th 2022, 7:07am

onresize BUG

Source code

1
2
3
4
5
6
7
8
<action name="add_map" autorun="onstart" >set(parameter_kyldlrbfgmbq, width=calc(device.normal ? stagewidth * 0.4 : stagewidth * 0.4),  height=calc(device.normal ? stageheight * 0.6 : stageheight * 0.6), );

addlayer(calc('addlayer' + 'kwvgcueuraja'));set(layer[calc('addlayer' + 'kwvgcueuraja')],type=container,keep=true,visible=true,bgcolor=0x2D3E50,bgalpha=1.0,x=0,y=0,zorder=999,align=center,edge=center);
</action>
<events name="events_pwbmkexehanv" keep="true" onresize="ufmorfxpbamv();"/>
<action name="ufmorfxpbamv">
set(layer[calc('addlayer' + 'kwvgcueuraja')].width,calc(device.normal ? stagewidth * 0.4 : stagewidth * 0.4));set(layer[calc('addlayer' + 'kwvgcueuraja')].height,get(parameter_kyldlrbfgmbq.height));trace('width==',layer[calc('addlayer' + 'kwvgcueuraja')].width,'  height==',layer[calc('addlayer' + 'kwvgcueuraja')].height);
</action>


Height cannot change value when dynamically changing window

*confused* *confused* *confused* *confused*

krpano-1.20.11

2

Tuesday, April 5th 2022, 7:37am

your ternary operators make no sense
sure you didnt mean
calc(device.normal ? stageheight * 0.6 : stageheight * 0.4)
?

panoyun

Intermediate

  • "panoyun" started this thread

Posts: 234

Location: Somalia

  • Send private message

3

Tuesday, April 5th 2022, 9:03am

I don't know what's wrong,
If it is invalid in the global event
You can test my code, you will understand when you change the window

4

Tuesday, April 5th 2022, 10:17am

calc(device.normal ? stagewidth * 0.4 : stagewidth * 0.4)
calc(device.normal ? stageheight * 0.6 : stageheight * 0.6)
makes no sense

you calculate parameter using stagewidth/height onstart
but onresize the stagewidth/height are changed

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<action name="mystart" autorun="onstart">
	calc(myparam, device.normal ? 0.6 : 0.4);
	trace('myparam=', myparam);
        // --> desktop+tablet 0.6, mobile 0.4
	addlayer(mylayer);
	set(layer[mylayer],
		type=container,
		keep=true,
		visible=true,
		bgcolor=0x2D3E50,
		bgalpha=1.0,
		x=0,
		y=0,
		zorder=999,
		align=center,
		edge=center);
</action>

<events name="myevents" keep="true" onresize="myonresize();" />

<action name="myonresize">
	calc(layer[mylayer].width, stagewidth * myparam);
	calc(layer[mylayer].height, stageheight * myparam);
	trace('width=',layer[mylayer].width,' height=',layer[mylayer].height);
</action>

ps.
set(a, get(b)) --> copy(a, b);
set(a, calc(b+c)); --> calc(a, b+c):

pps.
kyldlrbfgmbq pwbmkexehanv ufmorfxpbamv *wacko*
--> why are you doing this?

This post has been edited 20 times, last edit by "indexofrefraction" (Apr 5th 2022, 10:53am)


panoyun

Intermediate

  • "panoyun" started this thread

Posts: 234

Location: Somalia

  • Send private message

5

Tuesday, April 5th 2022, 10:19am

What is the correct spelling?
*smile*

panoyun

Intermediate

  • "panoyun" started this thread

Posts: 234

Location: Somalia

  • Send private message

6

Tuesday, April 5th 2022, 12:14pm

There are many, many actions, I use random 11 letters to combine unique names
Thank you for your help

*love* *love* *love* *love*