How to get a canvas from html document?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get a canvas from html document?

XumuK
I have this HTML: <canvas id="viewport" width="800" height="550"></canvas>

I need to get this canvas. How i can get it?

        var canvas = $(canvas).get(0);
        var ctx = canvas.getContext("2d");


        to smalltalk code in Amber

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: How to get a canvas from html document?

xekoukou
Does this work?

canvas := ('#viewpoint' asJQuery) at: 0.
ctx := canvas getContext: '2d'.


2013/4/4 XumuK <[hidden email]>
I have this HTML: <canvas id="viewport" width="800" height="550"></canvas>

I need to get this canvas. How i can get it?

        var canvas = $(canvas).get(0);
        var ctx = canvas.getContext("2d");


        to smalltalk code in Amber

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: How to get a canvas from html document?

Nicolas Petton
Yes, it does with a small modification. Change #at: to #get: like the following:

canvas := '#id' asJQuery get: 0.

Cheers,
Nico


On Apr 5, 2013, at 12:05 AM, Apostolis Xekoukoulotakis <[hidden email]> wrote:

Does this work?

canvas := ('#viewpoint' asJQuery) at: 0.
ctx := canvas getContext: '2d'.


2013/4/4 XumuK <[hidden email]>
I have this HTML: <canvas id="viewport" width="800" height="550"></canvas>

I need to get this canvas. How i can get it?

        var canvas = $(canvas).get(0);
        var ctx = canvas.getContext("2d");


        to smalltalk code in Amber

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: How to get a canvas from html document?

XumuK
Thanks a lot)

пятница, 5 апреля 2013 г., 2:38:27 UTC+4 пользователь nicolas petton написал:
Yes, it does with a small modification. Change #at: to #get: like the following:

canvas := '#id' asJQuery get: 0.

Cheers,
Nico


On Apr 5, 2013, at 12:05 AM, Apostolis Xekoukoulotakis <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="4-3zw6fBB6MJ">xeko...@...> wrote:

Does this work?

canvas := ('#viewpoint' asJQuery) at: 0.
ctx := canvas getContext: '2d'.


2013/4/4 XumuK <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="4-3zw6fBB6MJ">hubb...@...>
I have this HTML: <canvas id="viewport" width="800" height="550"></canvas>

I need to get this canvas. How i can get it?

        var canvas = $(canvas).get(0);
        var ctx = canvas.getContext("2d");


        to smalltalk code in Amber

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="4-3zw6fBB6MJ">amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="4-3zw6fBB6MJ">amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: How to get a canvas from html document?

XumuK
Sorry, but how i can convert


пятница, 5 апреля 2013 г., 2:52:09 UTC+4 пользователь XumuK написал:
Thanks a lot)

пятница, 5 апреля 2013 г., 2:38:27 UTC+4 пользователь nicolas petton написал:
Yes, it does with a small modification. Change #at: to #get: like the following:

canvas := '#id' asJQuery get: 0.

Cheers,
Nico


On Apr 5, 2013, at 12:05 AM, Apostolis Xekoukoulotakis <[hidden email]> wrote:

Does this work?

canvas := ('#viewpoint' asJQuery) at: 0.
ctx := canvas getContext: '2d'.


2013/4/4 XumuK <[hidden email]>
I have this HTML: <canvas id="viewport" width="800" height="550"></canvas>

I need to get this canvas. How i can get it?

        var canvas = $(canvas).get(0);
        var ctx = canvas.getContext("2d");


        to smalltalk code in Amber

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.