[Sugar-devel] Web activities canvas element

Manuel Quiñones manuq at laptop.org
Wed Oct 9 18:29:02 EDT 2013


2013/10/9 laurent bernabe <laurent.bernabe at gmail.com>:
> Hello,
>
> *) I am wondering whether I can safely replace, in an index.html file of a
> web activity, the <div id="canvas></div> with <canvas id="canvas"></canvas>
> ?
>
> Because the library I am using need a real canvas element.

You just put your <canvas> inside that <div>.

> *) Also, if I can use a real canvas element, how can set its size to the
> remaining size of the screen ? (As my laptop has a wider screen than XO
> ones).

It's possible by connecting to the window resize event in JS.  You can
see an example in Clock Web activity.

https://github.com/manuq/clock-web
http://manuq.github.io/clock-web/

-- 
.. manuq ..


More information about the Sugar-devel mailing list