Always in centre of screen

Get help using Construct 2

Post » Tue Jul 02, 2013 3:46 pm

I have been having a few issues with the positional audio. I want the listen point to be the centre of the screen at all times.

I therefore want to have an object that will always be positioned in the centre of the screen, even when the layout scrolls far away. I have tried putting it on a layer that doesn't scroll (HUD), but that didn't work. I think the code takes the position from its X and Y position, which is still at the beginning of the layout.

I then tried using the anchor behaviour (all four sides) on a normal layer, but that appeared to have the same result.

I have tried to put the listen point on the object that does all the scrolling, but sometimes it moves off to the left or right side of the screen, meaning the audio is usually coming out as central, rather than left or right aligned.

I just need the listen object to move around freely, but always be dead centre of the screen without the HUD or anchor, as they don't appear to be compatible.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
84
S
15
G
7
Posts: 990
Reputation: 11,229

Post » Tue Jul 02, 2013 3:53 pm

The way I'm reading this is that you don't want positional audio at all?
If you just use the play sound without specifying a position, won't it be at dead center?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 02, 2013 3:59 pm

@LittleStain I don't want the sound to come from the centre, I want whatever object is doing the listening to be in the centre. Sometimes things may be colliding off screen, and I want to be able to hear where they are.AnD4D2013-07-02 16:00:58
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
84
S
15
G
7
Posts: 990
Reputation: 11,229

Post » Tue Jul 02, 2013 4:02 pm

Strangely, if I have an object that is always trying to follow the anchored object, and have that as the listen object, it still doesn't work, even though its X and Y do appear to be changing.

At the same time, if I position the same object all the way to one side, and I approach it, the sounds do get louder.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
84
S
15
G
7
Posts: 990
Reputation: 11,229

Post » Tue Jul 02, 2013 4:11 pm

Oops, my bad! I had a system set up so that the listen point was designated before the object was created. Didn't think it would make a difference, but if an object is referenced and doesn't exist, it reverts to 0,0.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
84
S
15
G
7
Posts: 990
Reputation: 11,229

Post » Tue Jul 02, 2013 4:11 pm

[forget this]Do you use the scroll to behaviour or manually set the scroll to? This sometimes makes a difference..[/forget]

never mind.. glad you got it working..LittleStain2013-07-02 16:12:48
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests