Set size of instances

For developers using the Construct 2 Javascript SDK

Post » Thu Dec 29, 2011 1:52 am

Hi,

as I already told to @Ashley, I need to set projects settings in C2, etc... directly from plugins, specially from edittime.js (for interaction with plugins properties)....
I know, for the moment, that it's not possible to do it but:

from the edittime.js
is it possible to set the size of the plugin's object, of the instance ? For the moment, I've only found the way to get width and height but no way to set them.
Btw, is it possible to set/get the position of the instance in the layout ?

If it doesn't, I know that you've got an amount of things to do, but please, could you add those needs onto your todolist:

- set/get layout size
- set instance size
- set/get instance position
- set/get window size
and in future, a complete interface to modify/acces of all project settings from the edittime (fullscreen mode, webGL on/off, ...)

It will be REALLY useful.
Thanks
B
44
S
12
G
13
Posts: 628
Reputation: 10,471

Post » Fri Dec 30, 2011 8:58 am

If you look at Alert.as and/or AlertForm.as, it seems that the Alert is trying
to manage the proportions of the window on its own. It looks at the width of
the title and the width of the text, and then seems to break the text into
multiple lines to make the alert look somewhat square, as opposed to stretched

I wanted to have some more control over this, so I wrote a wrapper function to
display alerts that padded the title text with spaces until it was long enough
to create a window wide enough to hold my text with minimal wrapping
B
2
G
1
Posts: 3
Reputation: 606

Post » Fri Dec 30, 2011 12:05 pm

@Zollie08, what are you talking about? :S

@septeven, there are methods to set/get the instance size here:
http://www.scirra.com/manual/21/the-edit-time
Are you sure you need so much stuff to be accessed from the edittime? We are really pressed for time and I can't imagine why a plugin would need to change things like the WebGL setting? Also, since the edittime side of plugins is a bit limited right now, have you considered just doing everything on startup at runtime in your plugin? Changing any part of the edittime in a plugin is actually really complicated because it has to fully support the undo system, which can be pretty complicated if your plugin wants to make batch changes. I think I need to better understand what you're trying to do to justify it. Are you sure there are no good workarounds?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Fri Dec 30, 2011 12:25 pm

@Ashley

If you look at the posts from Zollie08, they look like clever spam.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,843
Reputation: 48,287

Post » Fri Dec 30, 2011 1:51 pm

@Ashley, about WebGL, it was the wrong example. I personally need to access to
- set/get layout size
- set/get instance position
- set/get window size
- Fullscreen in browser

As you may know, I'm actually developing a big plugin for mobile device.
In order to have an intuitive using, e.g. it would be usefull if the layout/window size could be changed from the plugin properties 'screen size' and 'screen orientation'

For that example, I'm sure the user could input the width and height himself, but that's definitely not the way I think that an user has to use a plugin. Specially here, it has to be automatical to prevent user to have to look for the resolution screen.

I hope you'll see what I mean, and why I consider this as usefull.
B
44
S
12
G
13
Posts: 628
Reputation: 10,471


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests