Anteworld - Outerra Game > JavaScript development

Methods

<< < (2/13) > >>

SteelRat:

--- Quote from: PytonPago on May 13, 2015, 05:04:53 pm ---
--- Quote from: SteelRat on May 13, 2015, 04:36:48 pm ---The problem is solved.
And the result of me not impressed (
The result has killed my idea!

--- End quote ---

 ... why ? ( could you share the files ? )

--- End quote ---

One more thing that should be checked, then share.

SteelRat:
Hi cameni!


--- Code: ---var $sketch = this.$query_interface("ot::js::sketch.get");

this.grp = $sketch.create_group();

// These two methods I understand
this.img = $sketch.load_image("ui/basic.imgset/airspeed");
this.img2 = $sketch.load_image2("ui/airspeed.dds");

$sketch.make_group_active(this.grp);
$sketch.attach_to_element(this.geom.get_inst_id(), true);
$sketch.set_xray_mode(true);

this.canvas = $sketch.create_canvas(this.grp, {x:-1,y:1,z:1});

// I do not understand the meaning of having two methods of implementing the same result
$sketch.draw_image(this.img, {x:0,y:0}, {x:60,y:60}, 0xffffffff);
$sketch.draw_image2(this.img2, {x:0,y:0}, {x:60,y:60}, 0xffffffff);

--- End code ---

cameni:

--- Quote from: SteelRat on June 28, 2015, 10:37:11 am ---// I do not understand the meaning of having two methods of implementing the same result
$sketch.draw_image(this.img, {x:0,y:0}, {x:60,y:60}, 0xffffffff);
$sketch.draw_image2(this.img2, {x:0,y:0}, {x:60,y:60}, 0xffffffff);

--- End quote ---

Me neither :D

For some reason Angrypig mixed two interface versions into one. Expect it to change soon.

SteelRat:
I understood  :)
thanks

SteelRat:
Hi cameni!


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

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

--- End code ---

The result on the screen
Speed: (white squares instead of numbers)

Tried so, the result is the same.

--- Code: ---var speed = this.speed().toString();
--- End code ---

How to?

And the associated question of how to format text?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version