Code for switching flash quality (+menu question)

Darkhog

  • Posts: 1243
As all we know Flash offer three qualities of display - low, medium and best where difference is antialiasing. I'd like to know how to do this with code, because I'd like to give user choice what quality they want to use (especially important on slow computers). Also this code would be useful for people who develop sprite games whom probably set it arbitrarily to low to have pixelated look (Stencyl example: Alien Approach).

Also I'd like to know how to edit Flash menu (and apply routines which are executed upon selecting menu option) from Stencyl's CM, because with Stencyl codemode we are limited to specific class template (even when using pure CM) and we can't add easily flash event listeners  (but I think it is possibly, just pretty hard).

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Alexin

  • *
  • Posts: 3130
Most Flash games have quality options because they use the normal vector engine. Since Stencyl uses Flixel, which in turn bypasses the vector engine and draws directly on a bitmap, those options make no sense.
At best, you could provide options for interpolation, etc, that you can already specify in SW.
"Find the fun"
alexin@stencyl.com

Darkhog

  • Posts: 1243
(...)those options make no sense.
No sense? So why games with high scale factor seems to have blurred pixels at edges? Especially visible in Nine Pixel game & Alien Approach.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Rhys

  • Posts: 1046
(...)those options make no sense.
No sense? So why games with high scale factor seems to have blurred pixels at edges? Especially visible in Nine Pixel game & Alien Approach.
Neither have blurred pixels.
Must be a linux thing.

Alexin

  • *
  • Posts: 3130
Read my previous post again Darkhog...
"Find the fun"
alexin@stencyl.com

Darkhog

  • Posts: 1243
OK, Alexin. How about... games and flash animations with quality set to low run faster on older and slower machines (like celeron 500) which are still present in many schools in third and fourth world countries (Poland)?

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Jon

  • *
  • Posts: 17526
Setting the quality lower will make no difference for bitmap games like ours, nor is this an issue at all when the right-click menu has always let you set the quality.

Darkhog

  • Posts: 1243
Setting the quality lower will make no difference for bitmap games like ours,
It will, because now even if Flash not succeed in improving quality of games it still try to which take CPU time (in modern computers it's matter of microseconds, but in said Celeron 500 it really make difference).
(..)when the right-click menu has always let you set the quality.

Too bad I can't open this right-click menu (all I get is pause screen). This is definitely Flixel's/Stencyl issue, because I am able to open it in all others flash apps (such as YT flash player or megavideo player).

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Rhys

  • Posts: 1046
OK, Alexin. How about... games and flash animations with quality set to low run faster on older and slower machines (like celeron 500) which are still present in many schools in third and fourth world countries (Poland)?
Since when was Poland a third or fourth (???) world country?

Jon

  • *
  • Posts: 17526
Setting the quality lower will make no difference for bitmap games like ours,
It will, because now even if Flash not succeed in improving quality of games it still try to which take CPU time (in modern computers it's matter of microseconds, but in said Celeron 500 it really make difference).
(..)when the right-click menu has always let you set the quality.

Too bad I can't open this right-click menu (all I get is pause screen). This is definitely Flixel's/Stencyl issue, because I am able to open it in all others flash apps (such as YT flash player or megavideo player).

That's certainly not the case on Mac/Win. I've never seen right-click bring up anything but the right-click menu, and it's impossible in Flash itself to react to a right-click. My only guess is that a right-click on Linux is causing the game to lose focus, which will trip off the pause screen. But even then, the menu should still show.

Darkhog

  • Posts: 1243
OK, Alexin. How about... games and flash animations with quality set to low run faster on older and slower machines (like celeron 500) which are still present in many schools in third and fourth world countries (Poland)?
Since when was Poland a third or fourth (???) world country?

Since Kaczynski brothers (now just one of them; comparisons to UnaBomber are appreciated) f-word censored by Darkhog all up.

Anyway I don't think it's flash or Linux itself fault, because with other flash apps like player on YT or megavideo everything's fine.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Hectate

  • *
  • Posts: 4643
Right-clicking does bring up the flash player context window, even in Flixel. Flixel hs no knowledge that the right mouse is ever pressed, that information is not transmitted to the flash "application". Instead, the Flash player tells the app that it's lost focus (since the user is interacting with a context menu for the player and not the app itself). That's what's causing the Flixel pause screen.
I know this for certain because I sit with my 3.5 year-old daughter and play flash-based games with her all the time. She has small hands so she doesn't always hold the mouse quite right, and occasionally will right-click (or click outside of the player window) on accident. Some flash games handle the interruption better than others, with Flixel's auto-pause being one of the more graceful ways. In some games it'll actually lock it up for a bit and get the context menu stuck waiting for input that isn't wanted on our part.
In short, if your not getting the context menu, it's due to the flash player (perhaps a setting? linux version differs due to the OS?), not the game/engine. To say it's the game's fault would be like blaming a bug in a word processer on the document you loaded into it.
I suggest a test. Go to Kongregate and try right clicking in about 20 different games of different types (but all flash). Be sure you're n the game and not an advertisement. What are the results?
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Darkhog

  • Posts: 1243
Vector/not flixel sprite games like SMB Crossover  opens menu, for Flixel ones such as Super Mario Tros menu opens, for old pre-dinosaur stencyl games like Asul menu is also present, for newest Stencyl & Flixel games menu is not shown. I believe this bug was introduced by one of new Flixel version (maybe on purpose).

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Alexin

  • *
  • Posts: 3130
Why would it be on purpose?

Anyway, that doesn't matter because we're using the same Flixel version since the switch to Flash (or pretty much the same).
"Find the fun"
alexin@stencyl.com

Darkhog

  • Posts: 1243
Asul (menu present) - Flixel 2.32
Fear Of Eights built using b367 (no menu) - ...flixel 2.32?! WTF? I think it must be some bug in Stencyl-related code in engine. I suggest Jon to check engine code for build Asul were built using to analyze what went wrong.

Thought Stencyl is using 2.35 now and that's reason of my bug-in-new-flixel accusations. Anyway menu or not, there is no option for changing quality (only Show profiler and items for standard flash options and aboutbox). At least in Asul.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D