Game Maker's Garage Forum

Game Maker's Garage => Announcements => Topic started by: Gan on December 26, 2011, 11:17:28 PM

Title: HTML5 Docs - I need your input
Post by: Gan on December 26, 2011, 11:17:28 PM
Quote
HTML5 GameMaker Help Documentation:

The HTML5 GameMaker is an online game maker with the sole purpose of allowing you to make online HTML5 games in a faster and easier manner.
Copyright to the Game Maker's Garage. Created by programmer Matthew French(AKA Gan).

Syntax:
If-Statement:
If 1 = 1 Then
   //Do Stuff
End If

For loop:
For i = 1 to 5
   //Do stuff involving i
Next

Declaring variables: (Should var be used to declare variables?)
myNum = 2;
myString = "cow";

Should all variables created be global? Or should they be local unless specified as global variables?

General Methods:
Game Open - Gets called when the game opens. This is where you load media.
Key Down - Gets called when a key is pressed down.
Key Up - Gets called when a key is released.
Mouse Down - Gets called when the mouse clicks.
Mouse Up - Gets called when the mouse is released.
Mouse Move - Gets called when the mouse moves.
Timer Tick - Gets called when the timer ticks. Should the timer's interval be changeable? Should there even be a main timer? Should the player be allowed to make their own timer that calls a method?
Game Close - Gets called when the application closes.

Methods:
Custom methods can be created that are callable.

Classes:
The main class contains the General Methods.
Custom classes can contain methods that can be called by CustomClass.CustomMethod().
Custom objects can be created from custom classes:
spaceship = new SpaceShip()
Global variables of custom objects can be set by:
spaceship.shield = 50

Commands:
I'm writing the syntax and structure for the HTML5 GameMaker. It'll guide me in my quest of creation.
I need your help, I'm determining how to set up things like creating variables. Global and local, declarations, ect...

Plus it'd be useful to know all the math functions, drawing, and input commands you guys want.

If you want to help out, just post your ideas and wants or quote the docs above and add stuff to it.
Title: Re: HTML5 Docs - I need your input
Post by: Circuit on December 27, 2011, 01:28:29 AM
This is great.  I'm really looking forward to using HTML5 GameMaker!

Concerning variables, I think it's really important to allow the user to define the scope of a variable: class-level, method-level, or block-level.  The scope should be implicit in the placement of the variable declaration.  A variable should be discarded from memory once it goes out of scope.

This is just my preference.  I recently finished a class on OOP in Java, and I really want to keep programming with that paradigm as much as possible.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on December 27, 2011, 01:58:54 AM
Sounds reasonable.

When defining a class, I can allow the definition of global variables.
var myGlobalVar = 2;

These global variables can be used anywhere. For objects, the global variables would be specific to that object.

Then local variables could be defined in methods and such:
var myLocalVar = 2;

I guess the user will be forced to initially declare variables. Should we use var or let to declare?
Title: Re: HTML5 Docs - I need your input
Post by: Circuit on December 27, 2011, 05:52:44 PM
I think var is better for declaration.  It has a clear meaning.  Let is more generic.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on December 27, 2011, 06:32:57 PM
Any reason you aren't declaring variables as a type like an int float or string? How would you handle that?
Title: Re: HTML5 Docs - I need your input
Post by: Gan on December 27, 2011, 08:08:02 PM
Funny thing about javascript. You don't need to declare types.

var myVar = 5;
var myVar2 = "cow';

Javascript is crazy like that, just so dynamic that is detects the type as the code runs...
So for simplicity sake I think I'll keep the same format:

var myVar = 5
var myVar2 = "cow"
Title: Re: HTML5 Docs - I need your input
Post by: x on December 28, 2011, 04:14:05 AM
Funny thing about javascript. You don't need to declare types.

var myVar = 5;
var myVar2 = "cow';

Javascript is crazy like that, just so dynamic that is detects the type as the code runs...
So for simplicity sake I think I'll keep the same format:

var myVar = 5
var myVar2 = "cow"

Welcome to the wonderful world of scripting languages.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 04, 2012, 10:04:53 AM
Hey guys, I need a bit more input.

Here's my idea for handling multiple classes:

A new project starts with a Main class. Containing the General Methods such as Game Open, Key Down, Mouse Down, Ect. You can add custom methods to the Main class.

There's a drop down box right above the Methods bar. The drop down box is where you select your classes. You can make a new custom class. If you select the new custom class, it'll show 1 General Method: On Construct. That happens when you make a new object of that class. From there you can add custom methods to that class.


What do you guys think? Simple enough? Have a better way?
Title: Re: HTML5 Docs - I need your input
Post by: Circuit on January 04, 2012, 01:57:59 PM
Sounds good to me.  I'm curious to know how (or if) you plan to support inheritance.  A drop-down menu could show the relationships between superclasses and subclasses, but it would require some other widget or a group of widgets to create the relationship first.  I hope that makes sense.
Title: Re: HTML5 Docs - I need your input
Post by: GMG Kurt on January 04, 2012, 04:35:16 PM
Funny thing about javascript. You don't need to declare types.

var myVar = 5;
var myVar2 = "cow';

Javascript is crazy like that, just so dynamic that is detects the type as the code runs...
So for simplicity sake I think I'll keep the same format:

var myVar = 5
var myVar2 = "cow"

Welcome to the wonderful world of scripting languages.

But can we declare types? Gan I enjoy being a memory whore, and if I can't whore my memory (wow that sounds horrible) then I can't be happy. I talking about the way C organizes it's data types, will we still be able to declare that way?
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 04, 2012, 05:22:58 PM
I have yet to learn much about memory management...
Part of it has to to with making sure unused code isn't always loaded right? And unused variables?
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 04, 2012, 05:26:58 PM
Kurt:
Nope. From what I've experienced var is the only way.

Circuit:
Thanks for the input Circuit. I actually hadn't thought of inheritance. A drop down selection would be easiest... though inheritance can be created just by making 2 different class alike.

Hmm, this might make things more confusing for the end user. Turns out for Javascript classes you declare class specific variables by this.myVar = 2.
Which begs the question, should custom classes have a Class Variables section where you define variables by "var myVar"?
Or should I just allow the On Constuct method(or any other method in the class) to handle variables and you create variables by "this.myVar=2"? So for normal variables you use var, and for class variables you use this.myVar or myObject.myVar to declare.

Connors:
Yeah sorta something like that. Mostly based on references and pointers of objects, deallocating objects when not needed, ect.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 04, 2012, 07:38:08 PM
You mean local variables for classes? That would be good.
myObject.myVar or this.myVar makes sense.
Title: Re: HTML5 Docs - I need your input
Post by: Circuit on January 07, 2012, 08:55:30 PM
Circuit:
Thanks for the input Circuit. I actually hadn't thought of inheritance. A drop down selection would be easiest... though inheritance can be created just by making 2 different class alike.
Will it be possible to create an array of similar types and perform the same operations on all of them?  (Provided that they have the same variables and methods.)  If so, then that's fine.

Hmm, this might make things more confusing for the end user. Turns out for Javascript classes you declare class specific variables by this.myVar = 2.
Which begs the question, should custom classes have a Class Variables section where you define variables by "var myVar"?
Yes.  If Javascript requires class variables to have full names (e.g. this.myVar), then make the interpreter automatically prefix the class names onto the variables when the code is translated into Javascript.

Or should I just allow the On Constuct method(or any other method in the class) to handle variables and you create variables by "this.myVar=2"? So for normal variables you use var, and for class variables you use this.myVar or myObject.myVar to declare.
Constructors shouldn't create variables, only initialize them.  IMO.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 07, 2012, 09:02:14 PM
Circuit:
Thanks for the input Circuit. I actually hadn't thought of inheritance. A drop down selection would be easiest... though inheritance can be created just by making 2 different class alike.
Will it be possible to create an array of similar types and perform the same operations on all of them?  (Provided that they have the same variables and methods.)  If so, then that's fine.

Hmm, this might make things more confusing for the end user. Turns out for Javascript classes you declare class specific variables by this.myVar = 2.
Which begs the question, should custom classes have a Class Variables section where you define variables by "var myVar"?
Yes.  If Javascript requires class variables to have full names (e.g. this.myVar), then make the interpreter automatically prefix the class names onto the variables when the code is translated into Javascript.

Or should I just allow the On Constuct method(or any other method in the class) to handle variables and you create variables by "this.myVar=2"? So for normal variables you use var, and for class variables you use this.myVar or myObject.myVar to declare.
Constructors shouldn't create variables, only initialize them.  IMO.
InJavascript you can declare class variables anywhere. The best place is in the constructor.
Title: Re: HTML5 Docs - I need your input
Post by: Circuit on January 09, 2012, 08:15:43 PM
InJavascript you can declare class variables anywhere. The best place is in the constructor.
That seems inconsistent with OOP, but I could probably get used to it.  It seems like a very efficient way to define classes.

I'm curious about what the relationship is between HTML5 GM and JavaScript.  HTML5 GM will have a scripting language which will be translated into JS.  But what makes them different?
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 09, 2012, 09:30:22 PM
Good question.

HTML5 GM will be more like SilverCreator. Syntax wise and structure.

Javascript has a very free structure. HTML5 GM will have a set structure to make it easier. Plus, dare I say it, syntax highlighting!

Right now I'm coding it in TextEdit and haven't found a nice, simple, light weight javascript editor that works as well as TextEdit.

Yeah, all commands will be in the docs and this will be tailored specifically to game making with the HTML5 canvas. Where as Javascript is open to everything, this will be narrow.
The HTML5 GM will be way easier than making a game in Javascript.
Title: Re: HTML5 Docs - I need your input
Post by: Charlo on January 09, 2012, 09:46:12 PM
If you're looking for a programmer's text editor, I recommend jEdit or notepad++.  I use jEdit for all of my JavaScript and PHP (even though jEdit's auto-indent can get messed up when confronted with jQuery).
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 09, 2012, 10:05:14 PM
I wish Notepad++ was natively for Mac...

I guess I can try Jedit.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 09, 2012, 11:55:05 PM
Major milestone:
A boatload of the interface is now functional.

Still working on designs for other interfaces within the Gm...
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 10, 2012, 10:01:34 AM
I can't wait to see how this works!
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 10, 2012, 11:03:24 AM
Just made a professional, super detailed, high quality down to the millimeter and exact mockup of how the Media tab will look:
(http://cl.ly/1344012N2215241U0y0C/Media%20Tab.png)

You like? (The arrows show how that field can resize)
Title: Re: HTML5 Docs - I need your input
Post by: GabrielCA on January 10, 2012, 12:50:49 PM
This sounds like an interesting project. Will the game editor be made in HTML5/JavaScript ?
Title: Re: HTML5 Docs - I need your input
Post by: GabrielCA on January 10, 2012, 12:55:20 PM
Here's some feedback

Quote
Declaring variables: (Should var be used to declare variables?)

Variables shouldn't have to be declared in a good scripting language, right ?

Quote
Should all variables created be global? Or should they be local unless specified as global variables?

To keep it noob-friendly and simple, I would suggest avoiding the overuse of OOP.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 10, 2012, 01:12:12 PM
Yeah, the game maker is in HTML5 and Javascript.

As for variables, we've decided to declare them using var so that there's a differentiation between local and global variables.

As for OOP, when you start making a game it's not OOP. But you can make classes and objects if you want OOP.
Title: Re: HTML5 Docs - I need your input
Post by: GabrielCA on January 10, 2012, 03:59:44 PM
Yeah, the game maker is in HTML5 and Javascript.

As for variables, we've decided to declare them using var so that there's a differentiation between local and global variables.

As for OOP, when you start making a game it's not OOP. But you can make classes and objects if you want OOP.
Neat. I'll stay tuned for releases.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 10, 2012, 06:52:04 PM
Major Milestone Reached:
Another chunk of the interface has been finished. The two main chunks are complete(though they'll probably need a some tweakage over time) and now I just have a few small interfaces and the main interpreter.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 10, 2012, 07:25:46 PM
The interpreter is one of the last things?...
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 10, 2012, 07:33:11 PM
Yeah, Interpreter is the big thing. Then again the very last thing is the saving feature.

Major Milestone Reached! (2 in one day! :O)
The interface is complete. Perhaps a little tweakage here and there. I'm now working on the interpreter.

Edit:
The interpreter appears to be working. Now just gotta add a whole buncha commands to do stuff.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 10, 2012, 09:21:21 PM
Hurray for doing STUFF!
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 10, 2012, 10:33:17 PM
How do you guys feel about a loose interpreter?

By loose I mean, you can just put in plain Javascript code and it'll work. Or you could put in the HTML5 GM syntax and it'll work.

I'm going to be making a lot of simple commands to make things easy on people, one command that does a whole bunch of complicated stuff so the user doesn't need to. Though I feel some people will want extra functionality. Such as getting down and dirty with normal Javascript commands.
Here's an example:
Drawing a line in HTML5 GM Script
Code: [Select]
DrawLine(100,150,450,50)
Drawing a line in Javascript but using it in the HTML GM
Code: [Select]
context.moveTo(100, 150)
context.lineTo(450, 50)
context.stroke()

Both do the same thing, one is easier, the other allows more flexibility.
What do you think? Good idea to allow both?

Edit:
Here's a spoiler!
(http://cl.ly/38091S0c3q0j2S0h3c1e/Screen%20Shot%202012-01-10%20at%2010.33.40%20PM.png)
It's working.....   buahahhahahhahaa
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 10, 2012, 10:51:45 PM
I say keep it in, it's another good feature! This would make it an incredibly useful tool for people who are willing to delve* deeper. Why take away functionality? And well done, Gan. Here we have the very first screenshot of this new tool!


*One of my favorite words.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 10, 2012, 11:33:10 PM
Will do!

*Excellent choice of words by the way

Edit:
Just added a complete, sophisticated, and precise down to the millimeter debugger:
(http://cl.ly/062V471L0F2P3O3z2v2K/Screen%20Shot%202012-01-10%20at%2011.34.35%20PM.png)
I feel I must go to bed(sorta cause I have work tomorrow) but I have a desire to stay awake and continue the progress!
Tomorrow I will continue tweaking. I have plans to copy lots of commands from SilverCreator's documentation and make HTML5 GM versions!
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 10, 2012, 11:54:05 PM
Looks faaantastic! Did you get that far with an interpreter in one day?

Oh and is that your final name? HTML5 Game Maker?
It's not bad it's just kind of the most obvious name possible.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 11, 2012, 12:00:12 AM
Well, I did work on the interpreter quite a bit a few days ago. Today all I had to do was update it to support classes and custom methods. :D Oh yeah, and debugging.

I'm thinking I like the name HTML5 GameMaker. It's easy to remember, it's obvious(which is much needed for beginners) and it can be shortened to HTML5 GM.

If you want a horrendous name, go look at some of those names for those android phones...
Sugon Universe Z IV Lightning G19 HD Inspire Pro 786b3
^Not an actual phone, just a mockery of one
Title: Re: HTML5 Docs - I need your input
Post by: Silverwind on January 11, 2012, 07:00:53 AM
GM5 could catch on. A logo with a tiny HTML between the GM and the 5 could work.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 11, 2012, 09:04:52 AM
Mmm, I think I like it...
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 11, 2012, 06:21:14 PM
Drawing demo!
http://f.cl.ly/items/1l1Z1E3Y1B0E0V1p3v2R/HTML5%20GM%20Demo%20-%20Broadband.m4v

Lines... lotsa lines. (If it seems slow, that's cause screen recording makes my whole computer slow)

Edit: I should probably specify. This demo is made up of a lot of 5 pixel long lines. Haha yeah. There's like a bazigigllion of them rendering each second.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 11, 2012, 08:02:14 PM
Update!

The interface and the interpreter are complete.

All I have left now is the HTML5 GM Commands I need to code/document and the saving feature...
Title: Re: HTML5 Docs - I need your input
Post by: Circuit on January 11, 2012, 08:45:11 PM
Awesome!  I'm really amazed at how quickly you're putting this together.  When do you think it will be ready?
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 11, 2012, 08:59:39 PM
It'll be ready... hmmmmm.

Well, I'm going on a long trip to florida tomorrow so I'm unsure if I'll be able to program much. Trip ends Monday, school starts Tuesday...

I'm going to delve(probably tonight) into SilverCreator's docs and start copying commands. Depending on how many commands I add to HTML5 GM will also affect the time.

Then the final feature I want to add is saving. Saving will work through the forum login. So that's the only seemingly tough thing I gotta figure out. When saving is successful, just gotta add a splash screen and put on the GMG!


I'd like to say... it'll be soon.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 12, 2012, 01:09:31 AM
CreateTimer(name,method,interval) - Creates a timer
StopTimer(name) - Stops the timer
StopAllTimers() - Stops all timers
KeyIsPressed(keyByLetter) - Returns true or false if the key is down
KeyIsPressed(keyByAsciiValue) - Returns true or false if the key is down
Key() - The last key pressed
MouseX() - The X position of the mouse
MouseY() - The Y position of the mouse
MousePressed() - Returns true or false if the mouse is pressed
LoadSound(name) - Loads the sound ahead of time
PlaySound(name) - Plays the sound, good for sound effects
PlaySound(name, id, loop) - Plays the sound, good for music cause can be stopped by the same id
StopSound(id) - Stops the sound
LoadImage(name) - Loads the image ahead of time
DrawImage(name,x,y, rotation) - Loads the image if not already loaded, then draws
GetImageSource(name) - Gets the source of the image
GetImageData(name) - Gets the raw image data for custom manipulation
DrawLine(x1,y1,x2,y2) - Draws a line
DrawOval(x,y,width,height) - Draws an oval
DrawPixel(x,y) - Draws a pixel
DrawRect(x,y,width,height) - Draws a rectangle
FillRect(x,y,width,height) - Draws a filled rect
DrawString(string,x,y) - Draws the string
ClearScreen() - Clears the screen
ScaleContext(x,y) - Scales the context in the canvas
RotateContext(rot) - Rotates the context in the canvas
TranslateContext(x,y) - Moves the context in the canvas
SetStrokeColor(color) - Sets stroke color
SetFileColor(color) - Sets fill color
Abs(num) - Absolute value of number
Arccos(num) - Arc Cos of number
Arcsin(num) - Arc sin of number
Arctan(num) - Arc tan of number
Arctan2(num,num) - 2nd Arc tan
Ceil(num) - Ceilings the number
Cos(num) - Cos of number
Sin(num) - Sin of number
Tan(num) - Tan of number
Floor(num) - Floors the number
Pi() - Returns PI
Random(num1, num2) - Returns a random whole number between num1 and num2
Round(num) - Rounds the number
Sqrt(num) - Square roots the number

context - The drawing context of the canvas. With this you can call native Javascript functions on the context of the canvas. Allows for greater HTML5 flexibility
canvas - The canvas of the game. You can access the 2D or 3D context, allows greater flexibility


That's my list of all the commands I want to add so far. Look good to you guys? Anything you would like added?
(If there's something you want to do that's doesn't have a command, you can search the Javascript for it and insert the Javascript into the HTML5 GM and it'll just work--That's what I call intense flexibility)
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 12, 2012, 07:55:22 AM
How will it save? If it saves onto the user's computer you can put it where you want, share it, back it up....
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 12, 2012, 08:08:07 AM
How will it save? If it saves onto the user's computer you can put it where you want, share it, back it up....
Hmmm. Haven't thought of sharing.

The plan is to have saving be automatic and in the cloud. The game will save every 2 minutes automatically to the GMG. It'll save under your forum account so only you can access it. It'll also save when you close the window and there will be a button where you can tell it to manually save.
I don't want people to lose data, this is the safest way.

As for sharing... at the moment you can export the compiled game to show off to people but I hadn't though of sharing the raw game code...

I suppose in the Export tab I can have a field where you can copy raw game data and then paste it to someone and they can load the raw game data from the main menu...
Title: Re: HTML5 Docs - I need your input
Post by: GMG Kurt on January 12, 2012, 11:51:52 AM
can u find the modulus of a number? ???
like: 5 % 2 = 1
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 12, 2012, 01:28:44 PM
Well if it's saved on the server maybe you can add an option for a file to be shared and others can load it. People WILL be making templates or engines or generally code they want to let others use.
But I still like the option of downloading/uploading files.
Title: Re: HTML5 Docs - I need your input
Post by: Circuit on January 12, 2012, 01:36:47 PM
There should be a method to calculate the distance between 2 points:

function distance (x1, y1, x2, y2)
{
  return Sqrt(POW(x1-x2, 2) + POW(y1-y2, 2));
}

EDIT: there should also be a method to raise a number to a given power.

function POW (base, exponent)
{
  //etc.
}
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 12, 2012, 03:14:25 PM
can u find the modulus of a number? ???
like: 5 % 2 = 1
Yeah that'd work.

Quote
Well if it's saved on the server maybe you can add an option for a file to be shared and others can load it. People WILL be making templates or engines or generally code they want to let others use.
But I still like the option of downloading/uploading files.
I like that idea.

Quote
There should be a method to calculate the distance between 2 points:

function distance (x1, y1, x2, y2)
{
  return Sqrt(POW(x1-x2, 2) + POW(y1-y2, 2));
}

EDIT: there should also be a method to raise a number to a given power.

function POW (base, exponent)
{
  //etc.
}
I'll make sure to add those.



I'm going to try and add portability functionality where you can share game code. In the export tab you'd click a download button where it downloads your game file, then people can import it to try it out.

Now that I think of it, people will want to be able to play other people's games. So! I think I'll add an extra feature in the export tab. Where you'll be able to click a button that uploads your compiled game to the GMG and gives you a link you can copy. When you go to the link it'll open up a web page with your game that you can play. Share the link, and others can play your game.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 12, 2012, 03:37:16 PM
You sure you want to take on adding all that to this site? If it attracts enough people like you wanted we'll need more space and that costs money.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 12, 2012, 04:14:36 PM
Well, the thing is, the site will only store text. The compiled versions and saved files won't be that big. A huge project would still maybe only take up 70kb of space.

I figure if we use 70 kb per project and per compiled game, then that's 140kb total per project. Then lets say the average person has 5 projects, that'd be 700kb.

If we got 1000 members actively using I suspect it'd reach 7mb. 10,000 members would make it go to 70mb.

I don't have much of a worry about space. The GMG seemingly has plenty of it. Plus if we're getting too large and need to expand, I'll put up an ad to pay for it.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 12, 2012, 05:25:37 PM
Sounds awesome! Does this mean it's loading any pictures or sounds from the user's computer?
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 12, 2012, 07:52:33 PM
Sounds awesome! Does this mean it's loading any pictures or sounds from the user's computer?
Good question. The user will have to upload his/her media onto the net. Their own site or some file hosting site.
To add an image to your game you just gotta paste the link of the image.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 12, 2012, 08:13:13 PM
And when it compiles?? ???
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 12, 2012, 08:15:23 PM
It still has the link and still works.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 15, 2012, 02:10:21 AM
Update time!

I finished all the commands! Can't tell ya if they work. I've tested some but I'll test the main ones. I'll probably leave some to you guys to test.
So far drawing seems to be perfect, works really well.

Now I just gotta add the saving feature and make a fancy splash screen. I'm unsure how difficult the saving feature will be.

Oh yeah, I also gotta add this:
Quote
I'm going to try and add portability functionality where you can share game code. In the export tab you'd click a download button where it downloads your game file, then people can import it to try it out.

Now that I think of it, people will want to be able to play other people's games. So! I think I'll add an extra feature in the export tab. Where you'll be able to click a button that uploads your compiled game to the GMG and gives you a link you can copy. When you go to the link it'll open up a web page with your game that you can play. Share the link, and others can play your game.

It's way too late, I'm off to bed.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 16, 2012, 05:43:48 PM
Been testing more...
http://f.cl.ly/items/2d3m1O3U0Q3k363T282C/HTML5%20GM%20Preview%20-%20Broadband.m4v

Oh yeah, and I've reached a bit of success in connecting it to the forum. Still working on it.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 16, 2012, 06:15:48 PM
Is image duplication gonna be an issue? It leaves stamps behind or somethin'.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 16, 2012, 06:16:23 PM
Ah, that's cause I didn't clear the canvas before the draw.

To clear the canvas you do:
ClearScreen()
Title: Re: HTML5 Docs - I need your input
Post by: Charlo on January 16, 2012, 06:40:24 PM
Been testing more...
http://f.cl.ly/items/2d3m1O3U0Q3k363T282C/HTML5%20GM%20Preview%20-%20Broadband.m4v

Oh yeah, and I've reached a bit of success in connecting it to the forum. Still working on it.
Nice choice of image.  I could always use more promotion.   ;)

Regarding connecting it to the forum's member database, there's probably a lot of documentation out there about integrating with SMF's login system. I'm guessing the password table is encrypted using SHA1 (or perhaps another algorithm).  If that's the case, you can just use the PHP function sha1() on the user-inputted password to determine if it matches what's in the database. 
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 16, 2012, 06:57:16 PM
Yeah, found some docs on that. Makes it real easy. You seem quite knowledgeable on this stuff...


Anywho I'm gonna work on designing more screenies...

Login Screen - If you are not logged in, this will show.
Main Menu Screen - If logged in, the main menu will show with the options:
• New Game - Creates a blank game.
• Choose Game - Shows a list of games saved in the cloud that you can edit.
• Load Game From File - Opens up a dialog where you choose the game and load it.
• Demo/Template Games - Shows a list of demo or template games that you can choose from. It'll make a new game for you, except contain the code of the Demo/Template game chosen.

Then for when you're making the game... It'll save the game to the cloud every 2 minutes. If unable to save it'll post red text in the top left exclaiming, "Unable to save...". There will also be a manual save button at the right. If you close it'll save the data, if unable to save on close it'll pop up a warning asking if you're sure you want to close.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 16, 2012, 07:53:14 PM
Login works.

Now to make the main menu and saving.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 17, 2012, 09:26:45 PM
I can't wait to see it. C:
Title: Re: HTML5 Docs - I need your input
Post by: Circuit on January 22, 2012, 09:00:10 PM
Hey Gan, how much longer until HTML5 GM is ready?  If you're stuck on the saving & loading features, just release HTML5 GM as it is, and add saving & loading later.  It's going to need a lot of testing, and we don't need to save games in order to test it.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 22, 2012, 09:49:47 PM
There's not a lot of point in putting out a release date for it...
But it would be fun to test it out Gan!
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 22, 2012, 10:17:10 PM
You guys are absolutely correct.

I need to release a beta soon and I dislike release dates with a passion. So I got my music blasting and I'm setting off with a fury.
I will work on it vehemently tomorrow as well. I want a beta released by Wednesday. I want saving cause it's irritating to lose awesome creations.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 23, 2012, 01:34:00 AM
Saving and loading is finished. Well, autosave isn't in yet. You gotta hit the button when you want to save.

To do:

I think that's it. Ya know, besides further tweaks, feature add-ins, and graphical/layout updates.

The game maker is perfectly functional now. I can release a beta. Though first I want to add game templates and demos so you guys aren't going in blind.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 23, 2012, 07:06:28 AM
Or at least put in a tutorial right?
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 23, 2012, 08:10:07 AM
Would you guys rather have a demo game that explains everything in comments? Or an actual tutorial that you can select on the main menu that shows pictures with text describing every tool?
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 23, 2012, 08:35:21 AM
Beh. I'll do both.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 23, 2012, 02:00:01 PM
Made a tutorial for the HTML5 GM. Goes over the basic tools. Now I'm gonna work on Game Template functionality. Then I'll make some test games to be used as templates.
Then I'm going to fix some bugs from my previous list of todo. And then I want to add some more export features.

I think I want to release a stable and well featured beta. So I'm gonna do most of the stuff on the todo list before this becomes public.

Edit: I was making a test game and found some nasty bugs in key detection. Good thing. Fixed now.
Title: Re: HTML5 Docs - I need your input
Post by: GMG Kurt on January 24, 2012, 09:45:39 PM
What did yu mean by SQL injection? I've only ever heard of mysql for logblock for minecraft servers.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 24, 2012, 10:17:21 PM
Sql databases hold data. SQL code manipulates the data. It is very fast and organized.
All data of this forum is stored in an SQL database.

SQL injection means sneaking some code in a query to manipulate or delete data.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 25, 2012, 12:17:56 AM
The whole language is based around storing and retrieving information? Sounds useful.
And have you got saving to work?

PS: a tutorial OR templates is great but we could test it with only one of those.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 25, 2012, 12:21:12 PM
Heh. You guys getting both.

(http://cl.ly/0P1y2B1D2h0k3O3X171n/Screen%20Shot%202012-01-25%20at%2012.20.01%20PM.png)
Edit: Before you say it, this is not a self portrait!
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 25, 2012, 03:28:50 PM
So who is it!? I MUST KNOW. O_O
Title: Re: HTML5 Docs - I need your input
Post by: Zoo on January 25, 2012, 03:35:46 PM
It's steven, of course!
Title: Re: HTML5 Docs - I need your input
Post by: Connors on January 25, 2012, 08:52:57 PM
Maybe I'll make a game about Steven.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on January 30, 2012, 12:47:26 AM
Big change!

Timers are no longer made through CreateTimer.

Instead you do var myTimer = new Timer(method, interval)
Title: Re: HTML5 Docs - I need your input
Post by: Zoo on February 04, 2012, 11:37:51 AM
Maybe I'll make a game about Steven.
Ok. Steven is a serial killer who roams the earth searching to kill waldo. In fact, if you look close enough at "Where's waldo in the gamemakers garage" you can see him. He enjoys toast with strawberry frosting and pink and white marshmallows on top. He prefers store brand crackers to the name brand kind and owns a bakery in narnia. He has a vacation home in candyland and enjoys going there to terrorize young travelers trying to get the the candy castle. He currently lives in Hoboken, new jearsey. He has a pet turtle named William.

I hope that's enough information, steven is a very private man and likes to keep to himself.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on February 04, 2012, 02:32:20 PM
Okay, I finished this cool toy with spaceships, I want to put it in my signature now.
http://gamemakersgarage.com/html5/HTML5-ShareGame.php?gameID=131

Could you keep the text onronc.deviantart.com above it? thanks!
Title: Shared Projects
Post by: Connors on February 04, 2012, 04:05:38 PM
If you could enter the names of people you want to allow to edit a project I'd really appreciate it. Me and Kurt were talking about collaborating and I know it would help if we start porting Space Marine.
All I ask is in addition to that program it to warn you when others are editing the project so you don't overwrite eachothers work.
Title: Re: HTML5 Docs - I need your input
Post by: Zoo on February 08, 2012, 04:48:50 PM
I'll contribute, but I can't do much in the HTML5 thingamabob.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on February 08, 2012, 05:28:00 PM
I'm going to branch off the HTML5 GameMaker to make an HTML5 Group Project GameMaker.

I'm going to chop a lot of stuff out, when you make a project, you can add people to be able to edit the game. There'll be a chat box incorporated into the interface. You'll be able to see who's editing what at all times.
I can't guarantee a time frame, I'll probably get started on it sometime.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on February 08, 2012, 10:15:09 PM
Yeeeeeeeaaaah the name just got even longer! 8)
Title: Re: HTML5 Docs - I need your input
Post by: GMG Kurt on February 12, 2012, 11:25:39 AM
*IDEA*
a guest user, so that people who just want to try it out can test some code. All the projects in the guest user would be deleted at the end of the month, to encourage people to make real users, and they'd have to have a real user to ask help, and post their game, so there's also that incentive.

The motivation for this is that people don't like making accounts, if they can try it out without an account it might seems more user oriented than most online programs.  ;)
Title: Re: HTML5 Docs - I need your input
Post by: Gan on February 12, 2012, 12:59:17 PM
I suppose that'd work. But I couldn't store guest data on the server. I could store it locally on the Guest user's computer. But it'd be lost if they emptied their cache or went to a new computer.
Title: Re: HTML5 Docs - I need your input
Post by: GMG Kurt on February 12, 2012, 01:18:10 PM
yeah it's the tradeoff for not being a user, oh and they shouldn't be able to export the code.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on February 12, 2012, 01:19:09 PM
Hmm. I suppose I could add a "Try" feature. Where they can play with Game Templates.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on February 12, 2012, 04:21:30 PM
That would be fine, they could get a preview and try editing templates but probably not save anything.
Title: Re: HTML5 Docs - I need your input
Post by: GMG Kurt on March 15, 2012, 02:56:54 PM
not to derail this or anything, but I was studying programming theory, and stumbled upon some interesting things, heres a few.
1.) the Lambda is the universal symbol for programming
2.) programming existed before computers (lambda calculus)
3.) the entirety of programming was invented by two guys (Alonzo Church & Stephen Cole Kleene)
4.) and HTML5GM is a Metaprogramming language

interesting topic... the wikipedia page kinda sucks though.
http://en.wikipedia.org/wiki/Programming_language_theory#Generic_and_metaprogramming

ps I mostly posted it here for the 4th point :p
Title: Re: HTML5 Docs - I need your input
Post by: Gan on March 15, 2012, 02:58:57 PM
Pretty cool facts.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on March 16, 2012, 06:06:45 PM
That actually makes perfect sense.
Quote
Metaprogramming is the generation of higher-order programs which, when executed, produce programs (possibly in a different language, or in a subset of the original language) as a result.
Title: Re: HTML5 Docs - I need your input
Post by: x on March 17, 2012, 07:30:25 PM
I disagree with 2-4, slightly.

2. It also existed before lambda--http://en.wikipedia.org/wiki/Ada_Lovelace

3. Alonzo Church & Stephen Cole Kleene only lay the foundations for programming. What about McCarthy who invented Lisp? Or Haskell Curry, who is behind the lambda and functional programming?! OR ALAN TURING?!!!! Or even Ada Lovelace who was rocking it back in the early 1800s.

4. Its a compiler. "A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language" - http://en.wikipedia.org/wiki/Compiler
Metaprogramming is slightly different. Its anything that produces, or modifies source code, at /run time/. Compilation happens before run time. A good example would be genetic programming or C macros: #define blah int blah = 10;

Title: Re: HTML5 Docs - I need your input
Post by: Gan on March 17, 2012, 07:45:42 PM
Mmmmm, Ada Lovelace. She was quite the woman.
Title: Re: HTML5 Docs - I need your input
Post by: x on March 17, 2012, 07:52:15 PM
Mmmmm, Ada Lovelace. She was quite the woman.

I'll say. Did you know theres a programming language based on her stuff, and named after her.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on March 17, 2012, 08:03:41 PM
I remember looking up "quine" because of an XKCD strip. It's a program that produces it's entire usable source code as the output. When you think about it it would be difficult to do.
Title: Re: HTML5 Docs - I need your input
Post by: x on March 17, 2012, 08:28:30 PM
I remember looking up "quine" because of an XKCD strip. It's a program that produces it's entire usable source code as the output. When you think about it it would be difficult to do.

Yeh, its crazy. Genetic programming is equally as crazy: http://en.wikipedia.org/wiki/Genetic_programming
Title: Re: HTML5 Docs - I need your input
Post by: Gan on March 17, 2012, 08:34:46 PM
Mmmmm, Ada Lovelace. She was quite the woman.

I'll say. Did you know theres a programming language based on her stuff, and named after her.
Beauty and intelligence. Some say she was the first programmer.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on March 17, 2012, 11:05:26 PM
Yeh, its crazy. Genetic programming is equally as crazy
I remember a video with a robot, where it has no idea what shape it is, and using an accelerometer in the middle it tests each motor repeatedly to find out what it's own construction looks like (very accurately!) and then the computer running it runs a series of simulations using an evolution-based system to simulate it walking and find the fastest way to walk across the table. So it's learning to walk, starting from the very beginning. I wish I could remember where it was, it was a little four-legged robot (so eight motors) with the sensor in the middle. It was walking with one foot pointed right at the goal so it wound up holding the two legs on the side up in the air (it didnt need them) and moving in a sort of smooth worm-like pattern rather than the sort of spidery walk you'd expect, because that's more efficient.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on March 18, 2012, 12:00:30 AM
I waaaaaannaaa seeee!
Title: Re: HTML5 Docs - I need your input
Post by: Connors on March 18, 2012, 02:59:42 PM
And I wanna find it but I can't. ??? I think it was somewhere on TED.com
Title: Re: HTML5 Docs - I need your input
Post by: GMG Kurt on March 18, 2012, 06:48:14 PM
I disagree with 2-4, slightly.

2. It also existed before lambda--http://en.wikipedia.org/wiki/Ada_Lovelace

3. Alonzo Church & Stephen Cole Kleene only lay the foundations for programming. What about McCarthy who invented Lisp? Or Haskell Curry, who is behind the lambda and functional programming?! OR ALAN TURING?!!!! Or even Ada Lovelace who was rocking it back in the early 1800s.

4. Its a compiler. "A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language" - http://en.wikipedia.org/wiki/Compiler
Metaprogramming is slightly different. Its anything that produces, or modifies source code, at /run time/. Compilation happens before run time. A good example would be genetic programming or C macros: #define blah int blah = 10;

Well if it existed before Lambda then that wikipedia article I read was wrong.
But doesn't it transform the code into javascript, and then execute that? it's acting like the C macros, in that it translates all the code, and then compiles and runs javascript.
Title: Re: HTML5 Docs - I need your input
Post by: x on March 22, 2012, 09:38:53 AM
I disagree with 2-4, slightly.

2. It also existed before lambda--http://en.wikipedia.org/wiki/Ada_Lovelace

3. Alonzo Church & Stephen Cole Kleene only lay the foundations for programming. What about McCarthy who invented Lisp? Or Haskell Curry, who is behind the lambda and functional programming?! OR ALAN TURING?!!!! Or even Ada Lovelace who was rocking it back in the early 1800s.

4. Its a compiler. "A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language" - http://en.wikipedia.org/wiki/Compiler
Metaprogramming is slightly different. Its anything that produces, or modifies source code, at /run time/. Compilation happens before run time. A good example would be genetic programming or C macros: #define blah int blah = 10;

Well if it existed before Lambda then that wikipedia article I read was wrong.
But doesn't it transform the code into javascript, and then execute that? it's acting like the C macros, in that it translates all the code, and then compiles and runs javascript.

A macro would be if it changed its own source code, before it got converted to javascript. Compilation involves parsing and conversion to another language.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on March 22, 2012, 10:42:38 AM
The HTML5 Docs ought to be alphabetized.
Title: Re: HTML5 Docs - I need your input
Post by: GMG Kurt on March 22, 2012, 03:03:03 PM

A macro would be if it changed its own source code, before it got converted to javascript. Compilation involves parsing and conversion to another language.
ah I see.
I think the doc are fine un-alphabetized, since you should read all of them anyways
Title: Re: HTML5 Docs - I need your input
Post by: Gan on March 24, 2012, 10:22:50 PM
I've been thinking of the docs, they are very unfriendly.

I think the best way would be to separate them into categories. Like Drawing, IO, ect... then alphabetize the commands.
Title: Re: HTML5 Docs - I need your input
Post by: GMG Kurt on March 25, 2012, 02:14:20 PM
or just add a search future, and remember I will be making a tutorial on how to use it, some time in the future.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on March 31, 2012, 10:16:58 PM
I've been doing tests with multiple canvases, i.e. layers.

Here is what I've found out:
• Having multiple canvases breaks some of the event handlers. For example, the Mouse Move event handler died cause it was being blocked by the other canvas.
Solution: Put all canvases in a div called "holder", tie all event handlers to the div.
• I can dynamically create, remove, and re-order canvases using javascript
Uses: This means people will be able to make more layers in their game whenever they want.
• You can draw to a canvas, and then draw that canvas to another canvas. And draw that canvas to another canvas. I call this, canvasception.
Meaning: You can greatly enhance the speed of a game that has customizable characters. Imagine, your character has equipped a hat, a sword, a shield, and a mustache. To draw all those, you'd have to redraw them every frame like this: (1) Draw character (2) Draw Hat (3) Draw sword (4) Draw shield (5) Draw mustache. Redrawing the whole character every frame is sloooooooow. Therefore the solution is to create a new canvas. Except it's called an Off-Screen canvas. You draw the player to the Off-Screen canvas once. Then you can draw the Off-Screen canvas to the On-Screen canvas whenever you need to show the player. This greatly increases game speed!
• Canvases are transparent at first.
So: They are perfect for layers! Especially when you want to add dynamic lighting to a scene.

Pretty awesome, huh?

So here's a layer specification I'm mocking up:
You start with 1 canvas by default.
You can create a canvas by:
Code: [Select]
var myCanvas = CreateCanvas(SizeX, SizeY)
Or get the main canvas by:
Code: [Select]
var myCanvas = GetMainCanvas()
Creating a canvas doesn't automatically add it to the screen, to add a canvas do:
Code: [Select]
AddCanvas(myCanvas)
You can move canvases so one will be on top of the other by setting the Z-Index:
Code: [Select]
SetCanvasZIndex(myCanvas, 10)
You can take canvases off the screen by:
Code: [Select]
RemoveCanvas(myCanvas)
You can set the main canvas by:
Code: [Select]
SetMainCanvas(myCanvas)

You're probably wondering, why do I need to set a main canvas?
Well, when ever you do a draw command, it automatically draws it to the main canvas. If you want to draw to a different canvas, you have to set your other canvas as the main canvas.

How do you guys feel about this layer specification? Should I call them layers or canvases?
I'll start coding this in when I get some approval.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on March 31, 2012, 10:34:45 PM
This sounds like a great plan to me! No need to change the names, keep calling them canvases. You should have a pre-defined variable called mainCanvas too so there is no need to declare "var myCanvas = GetMainCanvas()". It makes sense right?

Let me get this straight - On-screen canvases are always the size of the game screen. Off-screen canvases can be any size and you draw them onto the on-screen canvas like an image. On-screen canvases ALWAYS draw each time you change them. I'd assume they delete if you change their pointer, like any object.

So all I have left to add is: allow us to toggle on-screen canvases on or off.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on March 31, 2012, 10:47:42 PM
This sounds like a great plan to me! No need to change the names, keep calling them canvases. You should have a pre-defined variable called mainCanvas too so there is no need to declare "var myCanvas = GetMainCanvas()". It makes sense right?
Function would be better. Cause I have to run some code when you set and get it.

Quote
Let me get this straight - On-screen canvases are always the size of the game screen. Off-screen canvases can be any size and you draw them onto the on-screen canvas like an image. On-screen canvases ALWAYS draw each time you change them. I'd assume they delete if you change their pointer, like any object.
Actually, you can make them any size, on or off screen. To make them default size, call CreateCanvas() without specifying size. Yeah, you can draw canvases like images.

Quote
So all I have left to add is: allow us to toggle on-screen canvases on or off.
Toggle? You mean make canvas on screen to off screen and vice versa?
Just do AddCanvas(myCanvas) and RemoveCanvas(myCanvas).
Title: Re: HTML5 Docs - I need your input
Post by: Connors on March 31, 2012, 11:05:17 PM
Toggle? You mean make canvas on screen to off screen and vice versa?
Just do AddCanvas(myCanvas) and RemoveCanvas(myCanvas).
Say you don't want to see an on-screen canvas at the moment, but you don't want to lose what was in it? You might have to just draw it to an off-screen canvas (to keep the image) and temporarily remove it. Unless you could turn it on and off.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on March 31, 2012, 11:16:26 PM
Toggle? You mean make canvas on screen to off screen and vice versa?
Just do AddCanvas(myCanvas) and RemoveCanvas(myCanvas).
Say you don't want to see an on-screen canvas at the moment, but you don't want to lose what was in it? You might have to just draw it to an off-screen canvas (to keep the image) and temporarily remove it. Unless you could turn it on and off.
Removing doesn't destroy the canvas. It just removes it from the screen.
Here's an example:
Code: [Select]
var myCanvas = GetMainCanvas()
//Just got the main canvas
RemoveCanvas(myCanvas)
//The canvas is no longer on screen/visible but it still exists, you can still draw to it
AddCanvas(myCanvas)
//Canvas is back on screen, all good.

Prehaps I should make the commands more specific?
RemoveCanvasFromScreen(myCanvas)
AddCanvasToScreen(myCanvas)
Title: Re: HTML5 Docs - I need your input
Post by: Connors on March 31, 2012, 11:51:46 PM
Oh okay it makes perfect sense now. No need to change the name just make sure it's explained that well. Please don't make the names that long.
Example "KeyIsPressedByChar(char)" could have been "CharIsPressed(char)". Not that you should change it now, you could break people's code.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on April 01, 2012, 06:16:34 PM
Layer functionality has been added! Plus I added a way to detect when a media loads.

Code: [Select]
AddCanvas(canvas)
Adds the canvas to the screen.
Code: [Select]
SetCanvasZIndex(canvas,Z)
Sets the Z index of the canvas. Can rearrange canvases so one can be in front of the other.
Code: [Select]
RemoveCanvas(canvas)
Removes the canvas from the screen.
Code: [Select]
SetMainCanvas(canvas)
Sets the drawing canvas. You'll draw to this canvas when you do a drawing command.
Code: [Select]
GetMainCanvas(canvas)
Gets the main canvas.

Extra commands!
Code: [Select]
SetMediaLoadMethod(method)
Use this method to set the media load method. Meaning, the method you specify will be called whenever a media is loaded.
Ex:
SetMediaLoadMethod("MyMethod")
Code: [Select]
GetLoadedMediaName()
This pairs with the SetMediaLoadMethod(). This method returns the name of the last loaded media.
Code: [Select]
SetFont(font)
Sets the font of the current active canvas. Ex:
SetFont("60pt Calibri")
Code: [Select]
SetLineWidth(w)
Sets the width of the line for the main canvas.
Code: [Select]
SetLineCap(w)
Sets the cap of the line for the main canvas.
Ex: SetLineCap("square")
SetLineCap("round")
Code: [Select]
HideCursor()
Makes the cursor invisible.
Code: [Select]
ShowCursor()
Makes the cursor visible.
Code: [Select]
LeftArrowKey()
Returns the key code associated with the Left Arrow Key.
Code: [Select]
RightArrowKey()
Returns the key code associated with the Right Arrow Key.
Code: [Select]
UpArrowKey()
Returns the key code associated with the Up Arrow Key.
Code: [Select]
DownArrowKey()
Returns the key code associated with the Down Arrow Key.

What do you think?
Title: Re: HTML5 Docs - I need your input
Post by: GMG Kurt on April 01, 2012, 09:46:08 PM
returns the code? I'm sorry but what? do you mean it runs the function?

ooohhh a font setter that looks pretty nifty and simple,

I can't wait to try these out awesome update Gan
Title: Re: HTML5 Docs - I need your input
Post by: Gan on April 01, 2012, 10:00:52 PM
returns the code? I'm sorry but what? do you mean it runs the function?

ooohhh a font setter that looks pretty nifty and simple,

I can't wait to try these out awesome update Gan
Key code is a number associated with a key on the keyboard. The arrow key functions just return the number associated with that arrow key.
So you can type:
KeyIsPressed(DownArrowKey())
Instead of:
KeyIsPressed(40)

It's just a convenience thing.

Glad you're excited. ;D
Title: Re: HTML5 Docs - I need your input
Post by: Connors on April 01, 2012, 11:20:58 PM
So.... say that it returns the Key Code. be at least a little bit specific.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on April 01, 2012, 11:23:42 PM
So.... say that it returns the Key Code. be at least a little bit specific.
I do state that it returns the Key Code..
Code: [Select]
DownArrowKey()
Returns the key code associated with the Down Arrow Key.
Title: Re: HTML5 Docs - I need your input
Post by: Connors on April 02, 2012, 01:17:27 AM
Wasn't paying attention sorry, I think I'm just tired I'll see you tomorrow. Afternoon. If I escape from the dentist alive that is. Apparently my wisdom teeth are coming in at a rather unfortunate angle. Or they aren't coming in so much as attacking the teeth next to them. (they're going to move sideways into other teeth unless I get surgery. Kinda weird.)
Title: Re: HTML5 Docs - I need your input
Post by: Gan on April 02, 2012, 01:26:37 AM
Ouch. Hope ya survive the surgery.
Remember, morphine and laughing gas are your friends. Though don't use your phone when under the influence.
Especially Facebook, that's a big no no.
Title: Re: HTML5 Docs - I need your input
Post by: GMG Kurt on April 02, 2012, 07:41:43 PM
returns the code? I'm sorry but what? do you mean it runs the function?

ooohhh a font setter that looks pretty nifty and simple,

I can't wait to try these out awesome update Gan
Key code is a number associated with a key on the keyboard. The arrow key functions just return the number associated with that arrow key.
So you can type:
KeyIsPressed(DownArrowKey())
Instead of:
KeyIsPressed(40)

It's just a convenience thing.

Glad you're excited. ;D

oooooooohhhhhhhhh. ty Gan.
Title: Re: HTML5 Docs - I need your input
Post by: Gan on April 03, 2012, 08:47:32 AM
Forgot to mention, I've added a lot of new commands.

And I've separated the docs into "friendly" categories. Hopefully you guys can find stuff more easily.
Title: Прогнозы на спорт
Post by: PedroEndak on March 23, 2024, 05:17:45 PM
интернет
Прогнозы на спорт (https://t.me/+Xa2hu2Sbmrc2MDAy)