Weird interface issue 💦

Just started using Construct 2? Post your questions here

Post » Fri May 06, 2016 2:11 am

Wasn't sure what to name the subject but I'm trying to create an ingame interface that can be summoned with right clicking, trouble is when a character scrolls the window it messes up the behaviour of the interface;

Download here;
http://www.speedyshare.com/D5Hqu/windowtest.capx
or
http://www.filedropper.com/windowtest

Try right clicking somewhere before moving to see what it should do then move using the cursor keys (or WSAD) to the far right of the screen to see the issue, can anyone help?
B
9
S
3
Posts: 4
Reputation: 633

Post » Sat May 07, 2016 12:05 am

Hi, I don't really see what the issue is, it seems to work fine for me? What issue exactly are you having? :)

By the way, random aside from looking at your capx, you're testing whether the cursor sprite is over a button, but the cursor is so big it's very easy to click two buttons at once! Try testing the actual mouse cursor position rather than the image overlap, otherwise you'll have problems later :)
Image



Coming soon on Steam!
B
16
S
9
G
3
Posts: 204
Reputation: 3,466

Post » Sat May 07, 2016 12:19 am

Ohhh now I see it! I get it now.

Try using Mouse.AbsoluteX and Mouse.AbsoluteY to place your menu? Mouse.X and Mouse.Y get the coordinates of the mouse relative to the layout; AbsoluteX and AbsoluteY get the coordinates of the mouse relative to the actual canvas and isn't affected by scrolling. If that doesn't help you can try messing around with Mouse.X("layer"). I get the feeling the problem is something to do with the mouse coordinates and the zero parallax layer the menu is on. :)
Image



Coming soon on Steam!
B
16
S
9
G
3
Posts: 204
Reputation: 3,466

Post » Wed Jun 01, 2016 8:59 pm

Ah thanks for the suggestion will try giving that go!
B
9
S
3
Posts: 4
Reputation: 633

Post » Thu Jun 02, 2016 9:20 pm

@mikehive
Ah you were right about the layer parallax having something to do with it acting odd, I was just trying to keep the pop up menu still while the canvas was scrolling.
Also didn't have any luck with using AbsoluteX and Y, not really sure how to tackle this but thanks though!
B
9
S
3
Posts: 4
Reputation: 633

Post » Thu Jun 02, 2016 9:38 pm

Why not set the layer with the rightclick interface to the same parallax as the base layer? And just use normal mouse coord.

Differend parallax on layers is great to create depth or to pin a hud. Neither is needed here.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to Beginner's Questions

Who is online

Users browsing this forum: blackhornet and 1 guest