Forum

> > CS2D > Scripts > Mouse position incorrect
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Mouse position incorrect

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Mouse position incorrect

JonyFrosta
User Off Offline

Zitieren
When I change the screen resolution from 850x480 to some other (larger) one, the player(id, 'mousex') outputs a value only in the range up to x850 and y480

alt Re: Mouse position incorrect

Cure Pikachu
User Off Offline

Zitieren
I might be wrong but aren't the higher resolutions essentially just upscaling from the game's native 850x480 resolution?

And
player(id,"mousex")
and
player(id,"mousey")
are based off how we used to fetch their mouse position using cs2d lua cmd reqcld and cs2d lua hook clientdata , which scales off that native resolution (which is affected by cs2d cmd mp_hudscale)?
1× editiert, zuletzt 01.09.23 17:25:49

alt Re: Mouse position incorrect

JonyFrosta
User Off Offline

Zitieren
Yes, but when you create a image, it is in the range above 850x480 and the mouse does not go beyond these ranges. More precisely,
player(id, 'mousex')
does not output values higher than 850x480.

mp_hudscale 0

alt Re: Mouse position incorrect

SQ
Moderator Off Offline

Zitieren
Mouse position is in the context of gameplay pixel unit (world space)
Increasing resolution, does not increase your field of view.

This way you can check whether mouse is pointing on some object on the map regardless resolution. This is by design.

alt Re: Mouse position incorrect

JonyFrosta
User Off Offline

Zitieren
Thus, need adjusting the position of the images based on the resolution of 850x480? Im mean to scale the position based on 850x480?

alt Re: Mouse position incorrect

JonyFrosta
User Off Offline

Zitieren
@user Cure Pikachu: Yes, but that's not the only question.

@user SQ:
mp_hudscale
greatly distorts the image, makes it fuzzy if you change the resolution from smaller to larger.

I decided to completely rewrite the adaptation of the screen resolution, but when trying to find out the resolution from the player
player(id,'screenw')
it sometimes outputs incorrect values (slightly incorrect). Also, these values do not change or change crookedly for the Host (Starting the server through New Game and testing). Similarly for the
clientsetting
hook.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht