Some sort of zooming extension

letmethink

  • *
  • Posts: 2545
Basically I've built a zooming extension that needs some testing. I need some suggestions for blocks to add (I'm already planning on one so you can turn on zooming for the hud, but for now the default is off).

There are 4 blocks so far:
set zoom (obvious)
zoom (grabs the current zoom)
base zoom (for if you start scaled in full screen and it isn't 1)
draw on HUD (allows you to draw text unzoomed)

This extension doesn't work with flash or html5, but with everything else you should be able to properly zoom in and out. If there are any problems, let me know and I'll try to fix them.
~Letmethink

LIBERADO

  • *
  • Posts: 2720
Thanks a lot, but...
   
What is the "prepare zoom" block for?
What is the "base zoom" block useful for?

Also, I see the code suggested in other threads for making zoom seems to work in Flash and HTML5 too. So, why can't this extension work on these two formats?
   
An important issue: when using the "draw on HUD" block, the text appears pixelated and is not removed when you change it or stop drawing it.

« Last Edit: February 14, 2017, 01:18:35 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

airman4

  • Posts: 875
Awesome , i'll try it asap

edit
no flash , damn , i can't use it

« Last Edit: February 14, 2017, 01:39:32 pm by airman4 »

letmethink

  • *
  • Posts: 2545
Thanks a lot, but...
   
What is the "prepare zoom" block for?
What is the "base zoom" block useful for?

Also, I see the code suggested in other threads for making zoom seems to work in Flash and HTML5 too. So, why can't this extension work on these two formats?
   
An important issue: when using the "draw on HUD" block, the text appears pixelated and is not removed when you change it or stop drawing it.


The prepare zoom block can currently be used at the start of each scene to make scene transitions the correct size when zooming (otherwise they are messed up)

This extension allows zooming out. Due to the different rendering method of tiles on flash, it would be difficult (and exhaustive) to zoom out and then rerender which is how I would have to do it testing this way. Thus I have not put effort into getting this extension to compile on flash.

Could you check whether the same thing happens for actors attached to the HUD as that happens to text? Before I released this I had a version that worked differently but made the HUD layer display above the transition layer. Would this be preferable for you?
~Letmethink

LIBERADO

  • *
  • Posts: 2720
The prepare zoom block can currently be used at the start of each scene to make scene transitions the correct size when zooming (otherwise they are messed up)
OK.

This extension allows zooming out. Due to the different rendering method of tiles on flash, it would be difficult (and exhaustive) to zoom out and then rerender which is how I would have to do it testing this way. Thus I have not put effort into getting this extension to compile on flash.
Of course, the zooming-out feature is very important. I think avoiding such feature on Flash and HTML5 only and allowing it on other formats would be much more useful, less drastic and less problematic than making this extension totally incompatible with both formats. Otherwise, after exporting any game to other formats, when we need to export it to Flash or HTML5, we would have to disable this extension and remove its blocks, which is an inconvenience.

Could you check whether the same thing happens for actors attached to the HUD as that happens to text?
Tested, actors seem to work well.

Before I released this I had a version that worked differently but made the HUD layer display above the transition layer. Would this be preferable for you?
Yes, this would be preferable because displaying texts is always necessary and essential in any game.

« Last Edit: February 14, 2017, 02:45:59 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

colburt187

  • *
  • Posts: 2416
Awesome LMT, this is a huge feature, look forward to playing around with it!

LIBERADO

  • *
  • Posts: 2720
 :( This extension does not work in Stencyl 3.5
   

   

« Last Edit: May 21, 2017, 09:29:14 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

letmethink

  • *
  • Posts: 2545
:( This extension does not work in Stencyl 3.5
   

   

I'll just have to update it at some point. It should just be the matter of changing a couple of references because the engine has changed. Although I'm not sure entirely what's different.
~Letmethink

yoplalala

  • *
  • Posts: 1632
I did

#if(openfl >= 4.0.0)
import com.stencyl.Config as S 
#else
import scripts.MyAssets as S
 #end

and then replaced all  scripts.MyAssets by S 
So that the extension is compatible with 3.4 and 3.5

colburt187

  • *
  • Posts: 2416
Good work guys, if anyone is interest here is a video of a stencyl game using camera zoom thanks to letmethink. https://youtu.be/-Ac_Qz0LcNc

LIBERADO

  • *
  • Posts: 2720
#if(openfl >= 4.0.0)
import com.stencyl.Config as S 
#else
import scripts.MyAssets as S
 #end
After inserting this code at the start of the zoom.hx file, I always get this error:
     
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

yoplalala

  • *
  • Posts: 1632
Oh checked it. The "#if(openfl >= 4.0.0) " doesn't work.
But tried it . There are other problems because the system for tiles has changed. So it isn't a simple change. So we have to wait colburt187 :)

letmethink

  • *
  • Posts: 2545
Oh checked it. The "#if(openfl >= 4.0.0) " doesn't work.
But tried it . There are other problems because the system for tiles has changed. So it isn't a simple change. So we have to wait colburt187 :)
I imagine the "#if(openfl >= 4.0.0)" doesn't work because Stencyl has the version as 'openfl' because it uses its own version of openfl.
~Letmethink

yoplalala

  • *
  • Posts: 1632
Sorry I meant " wait for Letmethink" ;)
It seems it doesn't like the format "4.0.0". I'll have to ask Justin

BMJ

  • Posts: 278
LMT,

This is a wonderful extension -- thank you for making and sharing it. I would love to implement it in my game as it can solve all the problems with the shader zoom I had previously been using ... but there is one important problem that seems unresolved ... the text on the HUD layer comes out very jagged when you use the Draw on HUD block. On top of that, when the numbers on my HUD change they now draw on top of each other, rather than replacing each other like they used to.  It's really very unfortunate, as it renders this whole wonderful extension unusable without a fix, which is a real shame. The HUD is too important to sacrifice for a special effect.  Do you have any plans to fix this so we can use your extension? The people have been clamoring for a solid zoom effect in Stencyl for a long time and it's like ... oh man, right there ... if only . . .  :)

« Last Edit: July 10, 2017, 09:14:56 pm by BMJ »