Simple question about position in edior and some other questions
krumza

Hi! I create some plueprint in editor - in example 2 layer - game field and UI layer. In editor it look fine all in it place, but when i install this on server - Ui was moved to top and all my desing are broken.

Then i have i zooming game field and non-zooming and non-transforming Ui layer - i do it programmaticly in app.js, but if i try do it in editor - non-transforming are broke and Ui layer started transforming with other layers/

So i need more info about editor and logic of wade.

How i can do all only programmaticly - in example. 

How do template objects  use code only?

How i can create different scenes without wsc file? 

All 5 Comments
Gio

Hi

If you set a layer's transform and scale to 0 in the editor (see picture below), the layer should not move when the camera moves. I've just checked and this is working correctly here, is it not working for you?

When you install this on your server, could it be that the css in that page is modifying the position of wade canvas objects?

If you want to set the layer transform and scale programmatically, you can use wade.setLayerTransform

wade.setLayerTransform(uiLayer, 0, 0); // fixed ui layer

> How i can create different scenes without wsc file? 

There are several ways of doing this. You could create individual objects and add them to the scene. Alternatively you could create an object that contains all the data that a wsc file would contain. A wsc (it stands for Wade SCene) is just a plain JSON file. You can right-click it and select "Open in Code Editor" to see what's inside. Almost all the properties are optional, you only specify the ones that you need.

You call wade.importScene() and pass it an object that contains any of these properties:

  • json: An array of file names, describing which json files should be loaded. This can also be an array of objects in the format {resource: string, target: string} where resource is the file to load, and the result is stored in wade.app[target].
  • text: An array of file names, describing which text files should be loaded. This can also be an array of objects in the format {resource: string, target: string} where resource is the file to load, and the result is stored in wade.app[target].
  • audio: An array of audio file names
  • scripts: An array of script (.js) file names. Note that these scripts will be loaded and executed after the rest of the scene has been loaded, but before any scene objects are created and added to the scene
  • images: An array of image file names - you don't need to include files that are referenced by the scene objects and sprites in the scene (those will be loaded automatically).
  • minScreenSize: An object with x and y components describing the minimum screen size. Refer to the documentation of wade.setMinScreenSize() for more details
  • maxScreenSize: An object with x and y components describing the maximum screen size. Refer to the documentation of wade.setMaxScreenSize() for more details
  • windowMode: A string describing the window mode. Refer to the documentation of wade.setWindowMode() for more details
  • orientation: A string describing the orientation. Valid values are 'portrait' and 'landscape', all other values are ignored. See wade.forceOrientation() for more details
  • sceneObjects: An array containing all the SceneObjects to instantiate. See the SceneObject documentation for more details about the format to use
  • modules: An object where the name of each property is the name of an external WADE module whose importScene is called to load the scene data described by the value of that property
  • webAudioOnly: A boolean describing whether audio should only be loaded through WebAudio, and only where WebAudio is supported
  • loadGlTextures: A boolean describing whether WebGl textures should be created at loading time (only applies to sprites that are on WebGl layers)

 

> How do template objects  use code only?

I'm not quite sure what you mean by this. Do you want to create a template object in code? If so, you create a SceneObject and then call SceneObject.setAsTemplate()

krumza

the fact that I'm a little confused - some of the objects I create programmatically in the code, and the part in the editor, to understand in General the engine WADE - PATH for example 

And such a structure is very confusing - part of the code in the wsc file, the other part in app.js

I would like to understand how to do everything in code in one place. For example, the same manipulations on the screen size, adaptability

But template project entirely in code , unfortunately does not exist 

Many basic operations is completely incomprehensible to me

Gio

I'd like to clarify how it works.

You can create projects that are entirely code based and do nothing in the editor. You can also create projects that are made entirely in the editor, without adding anything to app.js. Or you can do a bit of both. It's completely up to you which way you want to do things.

The code snippets section shows you how to perform some basic operations in code. The Scripting with WADE, Step by Step Guides  and Interactive Guides sections in our tutorials page are a good introduction to creating projects in code without using the editor at all.

While we can create a few dozen examples to illustrate some basic operations, we cannot make millions of them to cover every possible case. But we are here to help :) So if there's something that you are trying to achieve but can't figure it out, simply ask here.

krumza

In the section of snippets is lacking a lot of things: path draw functions. For example, I long searched for what is originalDrawCall 

Reading section of the API also raises many questions - some functions well, is completely incomprehensible without an example

This is especially unpleasant not English speaking people like me. I unfortunately still easier to look at the code. 
Although your video is clear even to me - no knowledge of English, but alas, you are considering only the editor and only a small part of the engine

Please add snippets at the draw , path, webgl (in ideal every function in action) 

You are just very excellent engine , much better than the same phaser But the Phaser for example about 700 examples) and lots of templates on github

Maybe it'll even help the community if you don't have enough time. I would even he have done something, but so far unfortunately do not understand much

Gio

I agree we could have more examples and templates. The focus right now is on the development of new features (until we reach version 4), then we will focus on more examples, more up to date tutorials and generally making Wade easier to use.

Post a reply
Add Attachment
Submit Reply
Login to Reply