Problem with GetLayerAtPos()

Report any Hollywood bugs here
Post Reply
User avatar
Allanon
Posts: 464
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Problem with GetLayerAtPos()

Post by Allanon » Fri Dec 28, 2012 7:09 pm

Hello Andreas,
I'm wrinting a program that uses layers and I've added the possibility to resize the whole application using the #SCALEMODE_LAYER flag.
I've a problem when I used a scaled screen, let's say that I run my app on native res of 1366x768 and all is working fine but if I run it at the scaled resolution of 800x600 (for example) using ScaleWidth & ScaleHeight parameters the function GetLayerAtPos() seems to fail...

I mean, in the 800x600 scaled screen, MouseX() and MouseY() correctly returns the native resolution coordinates range (0-1366, 0-768) but GetLayerAtPos() does returns wrong results using

GetLayerAtPos(MouseX(), MouseY())

Should I scale the mouse coordinates manually or GetLayerAtPos() should care of the scaled screen coordinate system or there is a bug?
----------------------------
[Allanon] Fabio Falcucci
AMC - Creative Development // Docs Site // Support Forum
Support me on Patreon for Hollywood libraries!

User avatar
airsoftsoftwair
Posts: 3445
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with GetLayerAtPos()

Post by airsoftsoftwair » Sun Dec 30, 2012 11:17 pm

No, that's clearly a bug. GetLayerAtPos() should take care of handling layerscaling automatically. It's fixed now. Thanks for the report!

Post Reply