[BUG?] Panel object's hotspot not moved on resize

New releases and general discussions.

Post » Sat Sep 03, 2011 2:13 pm

Hi all.

This sure seems like a bug, let me paint the scene:

We have an object, let's say a sprite:


And then we have a panel object with a hotspot conveniently set to center:


So we go ahead and place the panel to the same position as our object:

So far so good:

Now we think - hey, it has a centre hotspot, so all we need to do is to resize it and set an angle and it will cover our object nicely:


But what happens is this:


Which is really quite bad. Is it bug, and if so, is it possible to fix it? That would REALLY help for certain things (in this case we were trying to do a bit of automated fake Ambient Occlusion).Somebody2011-09-03 14:17:19
B
19
S
6
G
7
Posts: 1,101
Reputation: 6,146

Post » Sat Sep 03, 2011 5:03 pm

Set its position to the top middle of your object and it will cover it right. Not sure why the hotspot doesn't scale with width and height though =S
"Construct 4 lets YOU make advanced games! (they wont run anywhere)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
125
S
42
G
17
Posts: 2,228
Reputation: 19,918

Post » Sat Sep 03, 2011 5:07 pm

I checked and it's really not working as intended, it should be fixed if possible.

But I found an workaround that can make things simpler: just use "Attach to object" and set the padding to 32, it automatically positions, rotates and resizes the panel to match the object.Animmaniac2011-09-03 17:18:21
Scirra Employee
B
156
S
53
G
17
Posts: 710
Reputation: 17,900

Post » Sat Sep 03, 2011 5:48 pm

Jayjay - I tried that, didn't seem to work right.

Animaniac - fantastic! Never even knew that option was there, d'oh. It works perfectly, although there are limitations (can't use it on panel objects - must be the same problem), but also it's great to be able to scale the occlusion effect by just changing one value.

Here's my little test area for this. I'd say such an effect certainly helps the walls become more grounded and no extra work from the user!Somebody2011-09-03 17:49:15
B
19
S
6
G
7
Posts: 1,101
Reputation: 6,146

Post » Sun Sep 04, 2011 2:57 am

ok, somebody, I believe I have fixed this, try copying this over your current panel.csx in the runtime directory
http://dl.dropbox.com/u/1013446/sharinplugs/panel/runtime/Panel.csx

this is your example cap, not using the attach feature of the panel:
http://dl.dropbox.com/u/1013446/sharinplugs/panel/somebodyspanels.cap

let me know if this works in other problem situations you've come acrosslucid2011-09-05 05:09:27
Spriter Dev
B
101
S
22
G
12
Posts: 3,265
Reputation: 17,056

Post » Sun Sep 04, 2011 7:30 am

Hey, lucid, amazing news, works like a charm now! Thanks - this should help with a future project quite a bit (if I ever get around to it, that is).Somebody2011-09-04 12:26:10
B
19
S
6
G
7
Posts: 1,101
Reputation: 6,146

Post » Mon Sep 05, 2011 4:49 am

I didn't know such plugin exists. I copied the file over original and now I get runetime error.
ImageImage
B
26
S
6
G
8
Posts: 774
Reputation: 6,685

Post » Mon Sep 05, 2011 4:52 am

[QUOTE=Noga] I didn't know such plugin exists. I copied the file over original and now I get runetime error. [/QUOTE]

Did you copy it to the Runtime directory?
Image ImageImage
B
171
S
50
G
179
Posts: 8,392
Reputation: 113,478

Post » Mon Sep 05, 2011 5:11 am

[QUOTE=Noga] I didn't know such plugin exists. I copied the file over original and now I get runetime error. [/QUOTE]

i think I accidentally swapped links, this is the runtime one:
(goes in \plugins\runtime\
http://dl.dropbox.com/u/1013446/sharinplugs/panel/runtime/Panel.csx
and this is the regular one in case you copied over it:
(goes in \plugins\)
http://dl.dropbox.com/u/1013446/sharinplugs/panel/Panel.csx
Spriter Dev
B
101
S
22
G
12
Posts: 3,265
Reputation: 17,056

Post » Mon Sep 05, 2011 5:23 am

I think I copied it into the runetime folder, but I'm not sure what I did anymore, doesn't matter now, it works. It's 6am here, probably should go to bed..
ImageImage
B
26
S
6
G
8
Posts: 774
Reputation: 6,685

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests