Anteworld - Outerra Game > JavaScript development

Methods

<< < (3/13) > >>

angrypig:
Hi,

the sketch API is not finished yet we are constantly adding new features and modding existing functions. Once we will have it ready we will release documentation for it. Probably in next update...

SteelRat:

--- Quote from: angrypig on July 02, 2015, 02:30:11 am ---Hi,

the sketch API is not finished yet we are constantly adding new features and modding existing functions. Once we will have it ready we will release documentation for it. Probably in next update...

--- End quote ---

I can not understand where the catch.
If I passed to this argument


--- Code: ---var txt = "" + "Speed 2: " + (1 + 2 + 3 + 4 + 5.6789);

--- End code ---

That data is displayed correctly.

SteelRat:
 :facepalm: :)

The correct version


--- Code: ---function update_frame(dt, engine, brake, steering)
{
...

if (this.canvas != undefined)
this.sketch.delete_canvas(this.canvas);

this.canvas = this.sketch.create_canvas(this.grp, {x:0,y:2,z:0});

var speed = Math.round(this.speed()*3.6);
var txt = "";
txt += "Speed: " + speed + "\n";
this.sketch.draw_text({x:0,y:0}, 0xffffffff, txt);
}

--- End code ---

Dear developers, do not forget about the method

--- Code: ---this.sketch.clear_canvas(this.canvas);

--- End code ---

SteelRat:
Hi cameni!


--- Code: ---// Ground vehicle

function init_chassis(){
...

this.add_weapon(); // arguments?
}

--- End code ---

cameni:
It's a placeholder function, does nothing yet.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version