Topic: Canvas trouble (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=31003" title="Pages that link to Topic: Canvas trouble (Page 1 of 1)" rel="nofollow" >Topic: Canvas trouble <span class="small">(Page 1 of 1)</span>\

 
racerX
Nervous Wreck (II) Inmate

From: Portland Oregon
Insane since: Jun 2006

posted posted 05-12-2009 06:55

I'm having trouble. I can make it work if I leave alerts each iteration. I'm not sure why it doesn't work without. I create an array with the new image.srcs then I loop through the array and assign the image.src to the current array position just before I have the canvas draw the image. I'm trying to avoid having 16 images when I can just swap the image src when i need to draw a new image. Is this bad practice? Should I use a timeout to give the image a chance to get the new src? I don't get it.
Here's a link to what I want the page to work like, except the alerts, of course. If the alerts are removed, it simply doesn't work.

http://h1.ripway.com/stirfry/javascript/tests/canvas/mapdraw/DrawonmapTest.html
this is adaptation of this script
http://ponderer.org/download/canvas_demo/

racerX
Nervous Wreck (II) Inmate

From: Portland Oregon
Insane since: Jun 2006

posted posted 05-12-2009 20:06

Got it figured out.

coach
Nervous Wreck (II) Inmate

From:
Insane since: May 2011

posted posted 05-31-2011 11:08
Edit TP: spam removed


Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu