Things I'd like to see built into Stencyl in 2017

ceosol

  • *
  • Posts: 2263
Like I said in a previous post, zoom is already in. LMT has an even better version of the code than what is below.

<a href="http://static.stencyl.com/games/35927-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/35927-0.swf</a>

twotimingpete

  • *
  • Posts: 1667
can it be centered rather than just zooming from the top left? and can the hud layer be exempted?

ceosol

  • *
  • Posts: 2263
I haven't played with it too much. I know there is something weird with HUD elements when zooming (at least in LMT's code).

ceosol

  • *
  • Posts: 2263
HUD elements could have a second code counteracting the zoom (i.e. if zoom is at 0.5, make the HUD elements at 200%)

twotimingpete

  • *
  • Posts: 1667
Someone made a zoom shader at some point but I don't know how to center it.

Example: https://gfycat.com/CourageousForthrightAmericancrow

This is the shader.

Code: [Select]
varying vec2 vTexCoord;
uniform sampler2D uImage0;
uniform vec2 uResolution;

uniform float x;
uniform float y;
uniform float zoom;

void main()
{

vec2 coord = vTexCoord + (vec2(x, uResolution.y - y) / uResolution - vTexCoord) * zoom;
gl_FragColor = vec4(texture2D(uImage0, coord));

}


ceosol

  • *
  • Posts: 2263
In the example I showed above, the bottom value is half of the window (in relations to the screen width zoomed in/out). The number above that is where the mouse is on the scene.

Example 1: if the zoom is 1, the half window will be 320 and the mouse on the screen will also be 320.
Example 2: if the zoom is 0.5, the half window is now 640 because the total window would be 1280 and the mouse will still be 320 because it is in the middle of the screen.
Example 3 (would be off of the screen): If zoom is 2, the half window will be 160 because the total window will be 320. The mouse would always be at 320.

Knowing that information, the camera could shift along the same lines as the zoom.

1: The camera would be at 0,0 for the screen to be centered
2: The camera would be at -320,0 since the screen is 1280 instead of 640, the 320 shift to the left would center it on the x
3: The camera would be at 160,0 since the screen is 320 instead of 640, the 160 to the right would center it for x.

twotimingpete

  • *
  • Posts: 1667
oh. duh. in the shader I showed above the x and y attributes can be used to set the camera's focus. durr.

okay, there's a working zoom shader for anyone who is on windows export.

Tepastelija

  • Posts: 51
Haxe is now officially updated to build 3.4, so big question, how's it going with upcoming update to new openfl Justin?

Donni11

  • *
  • Posts: 2182
This is what justin wrote on discord:

Quote
Yeah, I'm just working on fixing up some stuff before the 3.4 release
But as soon as that's done there's gonna be a bunch of haxe and openfl updates in order
Peace


thechaosengine

  • *
  • Posts: 329
I'd like to see folders for projects. I keep ending up w 20 games named skatedog001, skatedog002 etc, being able to put those into one folder called skatedog would help a ton.

KramerGames

  • Posts: 405
I'd like to see folders for projects. I keep ending up w 20 games named skatedog001, skatedog002 etc, being able to put those into one folder called skatedog would help a ton.

+1

If it doesn't exist yet, 2 things would make creating games in Stencyl a lot easier for me:

1. A copy and replace function. Like inside an event you can replace all "set attribute x to..." with "set attribute y..."

2. A shortcut for deleting blocks. Like you hold down a keyboard key, and then every block you click will be deleted.
Parasites United  (Idle Parasite Game)

ceosol

  • *
  • Posts: 2263
Quote
1. A copy and replace function. Like inside an event you can replace all "set attribute x to..." with "set attribute y..."

There was a bug in 2.x where you could replace all attribute blocks to a new attribute. I forget how I did it or else I would try it on 3.x.