diff --git a/README.BBCode b/README.BBCode index 18a6133..5293cbd 100644 --- a/README.BBCode +++ b/README.BBCode @@ -1,6 +1,6 @@ [size=14pt][b]rellax[/b][/size] [color=gray][b]version 0.3.1[/b][/color] -[url="https://github.com/ericoporto/rellax/releases/download/0.3.1/rellax.scm"]Get Latest Release [b]rellax.scm[/b][/url] | [url="https://github.com/ericoporto/rellax"]GitHub Repo[/url] | [url="https://github.com/ericoporto/rellax/releases/download/0.3.1/rellax_demo_windows.zip"]Demo Windows[/url] | [url="https://github.com/ericoporto/rellax/releases/download/0.3.1/rellax_demo_linux.tar.gz"]Demo Linux[/url] | [url="https://github.com/ericoporto/rellax/archive/master.zip"]Download project .zip [/url] +[url="https://github.com/ericoporto/rellax/releases/download/0.3.2/rellax.scm"]Get Latest Release [b]rellax.scm[/b][/url] | [url="https://github.com/ericoporto/rellax"]GitHub Repo[/url] | [url="https://github.com/ericoporto/rellax/releases/download/0.3.2/rellax_demo_windows.zip"]Demo Windows[/url] | [url="https://github.com/ericoporto/rellax/releases/download/0.3.2/rellax_demo_linux.tar.gz"]Demo Linux[/url] | [url="https://github.com/ericoporto/rellax/archive/master.zip"]Download project .zip [/url] Rellax while the camera tracks with cool parallax diff --git a/package.json b/package.json index a691ce5..83e4ed5 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,6 @@ "name": "rellax", "text": "Rellax while the Camera tracks with cool parallax.", "forum": "https://www.adventuregamestudio.co.uk/forums/index.php?topic=57489.0", - "version": "0.3.1", + "version": "0.3.2", "author": "eri0o" } diff --git a/rellax.asc b/rellax.asc index 28a6c73..741708f 100644 --- a/rellax.asc +++ b/rellax.asc @@ -1,5 +1,5 @@ // Rellax -// 0.3.1 +// 0.3.2 // A module to provide smooth scrolling and parallax! // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // Before starting, you must create the following Custom Properties @@ -69,11 +69,18 @@ Character* _TargetCharacter; Vec2* _TargetPos; // Parallax objects -Object* _pxo[MAX_PARALLAX_OBJS]; -int _pxoRoomStartX[MAX_PARALLAX_OBJS]; -int _pxoRoomStartY[MAX_PARALLAX_OBJS]; -int _pxoOriginX[MAX_PARALLAX_OBJS]; -int _pxoOriginY[MAX_PARALLAX_OBJS]; +struct ParallaxObject { + Object* Object; + int RoomStartX; + int RoomStartY; + int ObjectOriginX; + int ObjectOriginY; + bool HasParallax; + float ParallaxX; + float ParallaxY; +}; + +ParallaxObject _pxo[MAX_PARALLAX_OBJS]; int _pxo_count; // Tween Stuff @@ -429,12 +436,12 @@ void _r_do_object_parallax(){ int camy = FloatToInt(_next_cam_pos.y); for(int i=0; i<_pxo_count; i++){ - if(_pxo[i].GetProperty("PxPos") !=0 || _pxo[i].GetProperty("PyPos") != 0) { - float parallax_x = IntToFloat(_pxo[i].GetProperty("PxPos"))/100.0; - float parallax_y = IntToFloat(_pxo[i].GetProperty("PyPos"))/100.0; + if(_pxo[i].HasParallax) { + float parallax_x = _pxo[i].ParallaxX; + float parallax_y = _pxo[i].ParallaxY; - _pxo[i].X=_pxoOriginX[i]+FloatToInt(IntToFloat(camx)*parallax_x); - _pxo[i].Y=_pxoOriginY[i]+FloatToInt(IntToFloat(camy)*parallax_y); + _pxo[i].Object.X = _pxo[i].ObjectOriginX + FloatToInt(IntToFloat(camx)*parallax_x); + _pxo[i].Object.Y = _pxo[i].ObjectOriginY + FloatToInt(IntToFloat(camy)*parallax_y); } } } @@ -676,7 +683,7 @@ void set_TargetCharacter(this Rellax*, Character* target) Character* get_TargetCharacter(this Rellax*) { - return _TargetCharacter; + return _TargetCharacter; } void set_EasingType(this Rellax*, RellaxTweenEasingType value) @@ -830,24 +837,44 @@ void doSetOrigins () float room_h = IntToFloat(Room.Height); for(int i=0; i>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // Before starting, you must create the following Custom Properties diff --git a/rellax.scm b/rellax.scm index d5e98af..f483e43 100644 Binary files a/rellax.scm and b/rellax.scm differ diff --git a/rellax.xml b/rellax.xml index d4e12fb..1e3f32f 100644 --- a/rellax.xml +++ b/rellax.xml @@ -3,6 +3,6 @@ rellax Rellax while the Camera tracks with cool parallax. eri0o - 0.3.1 + 0.3.2 1909973127