A little lag when the screen is scrolling

Started by DiegoHolt, Tue 01/10/2024 17:52:59

Previous topic - Next topic

DiegoHolt

#20
@Khris I did try that module, but after creating the properties I'm getting this error message:

Smooth Scrolling & Parallax.asc(305): Error (line 305): undefined symbol 'GetViewportX'

This are the code lines, and I'm guessing the next one will give an error as well:

int viewx = GetViewportX();

int viewy = GetViewportY();

Crimson Wizard

Quote from: DiegoHolt on Fri 04/10/2024 18:20:11Smooth Scrolling & Parallax.asc(305): Error (line 305): undefined symbol 'GetViewportX'

This are the code lines, and I'm guessing the next one will give an error as well:

int viewx = GetViewportX();

int viewy = GetViewportY();

Either:
1. Set "Script compatibility level" to 3.4.* (in General Settings)
2. Replace by Game.Camera.X, Game.Camera.Y respectively.

Where to find replacements for deprecated functions:
https://adventuregamestudio.github.io/ags-manual/ObsoleteScriptAPI.html

DiegoHolt

Thanks for the quick answer, @Crimson Wizard

I've changed to Game.Camera but now I'm getting this error:

Smooth Scrolling & Parallax.asc(556): Error (line 556): '.ViewportWidth' is not a public member of 'System'. Are you sure you spelt it correctly (remember, capital letters are important)?

This is the line:

Code: ags
PxObjOriginX[NumberObj] = object[objectpass].X + FloatToInt((IntToFloat(object[objectpass].X)/IntToFloat(Room.Width))*(IntToFloat(Room.Width-System.ViewportWidth)*3.0));

I haven't tried the script compatibility because I don't know where to do that.

Crimson Wizard

Quote from: DiegoHolt on Fri 04/10/2024 18:32:11Smooth Scrolling & Parallax.asc(556): Error (line 556): '.ViewportWidth' is not a public member of 'System'. Are you sure you spelt it correctly (remember, capital letters are important)?

This is a similar problem.
https://adventuregamestudio.github.io/ags-manual/ObsoleteScriptAPI.html

System.ViewportHeight  --->   Screen.Height
System.ViewportWidth  --->   Screen.Width

Quote from: DiegoHolt on Fri 04/10/2024 18:32:11I haven't tried the script compatibility because I don't know where to do that.

It's in General Settings:
https://adventuregamestudio.github.io/ags-manual/GeneralSettings.html#backwards-compatibility

SMF spam blocked by CleanTalk