stage ratio & resolution changer

Extending or modifying the GP system itself (advanced!)

Moderator: MSandro

Post Reply
MSandro
Posts: 162
Joined: Jul 26th, '17, 21:12

stage ratio & resolution changer

Post by MSandro » Mar 28th, '18, 13:52

Hi, I've played around with the code of the GP IDE since a view weeks. I try to discover how to make simple changes and tweaks.

Maybe some of you would like to create a program with GP and think 800x500 is not enough and the ratio of 16:10 does not fit your idea.

This is a very simple extension which adds two blocks:
stage.png
stage.png (4.82 KiB) Viewed 13775 times
Warning: this extension is not ment to be used in your projects, it is ment as a tool to help you change the GP stage wiith some very small automated changes in the GP source files.

What this extension does:
Those two blocks are searching for some special files in your /GP-beta-079/runtime/lib/ foldger:
The "set stage ratio" block change a line in the "ProjectEditor.gp" file. The line 80 in this file looks like this in a default GP installation:

Code: Select all

  stage = (newStage 16 10)
This block can change this line for you with the input of two numbers, the screen ratio of your choice.


The "set stage width" block only needs one value to set the pixel amount of the stage width in the file "Stage.gp" on line 42.
This line looks like this by default:

Code: Select all

  majorAxis = 800
So this block only change a variable in one of GPs source-code files.


If you run one of those two blocks, GP will change the corresponding file with your entered values. After this it will ask you for restarting GP. This will only run the exit command of GP and NOT start it again automaticaly. I try to add a automatic restart of the GP IDE but I am not sure if this is posible.

This extension was made for GP v079 and it could break your files if you use it in other versions! But it should work on all supported systems like Linux, Windows and Mac OS, it will not work in the browser version of GP.

stage_changer_GP079.gpp
(7.78 KiB) Downloaded 946 times
I hope this helps those of you who do not want to tinker with the code of GP yourself.
~ MSandro

User avatar
Picochilla
Posts: 28
Joined: Sep 23rd, '17, 17:44

Re: stage ratio & resolution changer

Post by Picochilla » Mar 29th, '18, 07:55

Wow, nice work! Thank you very much for this, it is realy helpful.

But I have one suggestion:
Wouldn't it be better if you integrated it into a kind of "GP settings app"?
With maybe some sections like "Stage" and other for what ever you'll be able to change in the GP-Code.

I think this should't be a plugin, but nice work!

MSandro
Posts: 162
Joined: Jul 26th, '17, 21:12

Re: stage ratio & resolution changer

Post by MSandro » Mar 29th, '18, 13:20

Nice idea, I'll do this.

Post Reply