<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>animation with images</title>
		<link>http://kogics.wikidot.com/forum/t-1038955/animation-with-images</link>
		<description>Posts in the discussion thread &quot;animation with images&quot;</description>
				<copyright></copyright>
		<lastBuildDate>Mon, 10 Aug 2026 11:19:23 +0000</lastBuildDate>
		
					<item>
				<guid>http://kogics.wikidot.com/forum/t-1038955#post-2130741</guid>
				<title>(no title)</title>
				<link>http://kogics.wikidot.com/forum/t-1038955/animation-with-images#post-2130741</link>
				<description></description>
				<pubDate>Mon, 13 Oct 2014 15:09:04 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>The general strategy for doing Picture based animation is:</p> <ul> <li>clear the screen.</li> <li>create your pictures.</li> <li>draw your pictures (a picture can only be drawn once).</li> <li>animate some of your pictures in an animation loop. This involves: <ul> <li>transforming drawn pictures.</li> <li>erasing drawn pictures and creating/drawing new ones.</li> <li>wiping all pictures and creating/drawing new ones.</li> </ul> </li> </ul> <p>Here's some code showing this in action:</p> <div class="code"> <pre><code>// you dont need to use Staging with Pictures cleari() val im = PicShape.image(Costume.car) val line = PicShape.hline(100) // val background = ... draw(im, line) // draw(background) val ang = 1 var totalAngle: Int = _ var angLabel: Picture = _ onAnimationStart { // initialize vars here totalAngle = ang angLabel = trans(120, 0) -&gt; PicShape.text(totalAngle, 15) draw(angLabel) } animate { im.rotate(ang) line.rotate(ang) angLabel.erase() totalAngle += ang angLabel = trans(120, 0) -&gt; PicShape.text(totalAngle, 15) draw(angLabel) // let the background be }</code></pre></div> <p>Hope that points you in the right direction. Feel free to ask questions about any further problems you run into (and feel free to post your canon animation code to get further help. You can email me the image files at pant dot lalit at gmail dot com).</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-1038955#post-2130558</guid>
				<title>(no title)</title>
				<link>http://kogics.wikidot.com/forum/t-1038955/animation-with-images#post-2130558</link>
				<description></description>
				<pubDate>Mon, 13 Oct 2014 10:06:00 +0000</pubDate>
				<wikidot:authorName>lexand</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>uups</p> <p>thanks ;)</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-1038955#post-2130557</guid>
				<title>animation with images</title>
				<link>http://kogics.wikidot.com/forum/t-1038955/animation-with-images#post-2130557</link>
				<description></description>
				<pubDate>Mon, 13 Oct 2014 10:04:11 +0000</pubDate>
				<wikidot:authorName>lexand</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Salutations</p> <p>we need some help&#8230;</p> <p>We want in teaching purposes write small games with two cannons. The main problem now is how to do correct animation with loaded images ?<br /> We want that children draw two cannons and background. Than we scan this pictures, extract background and canons and put in into Kojo scene.<br /> So the problems:<br /> 1. every drawn image overlaps the image we want to draw at runtime (example below)<br /> 2. we have original canon image that is paralel to X axis, and we want to rotate it in absoulte manner like &quot;rot(13) -&gt; im&quot;, but not in reference manner like in example below.<br /> 3. how correctly we should draw the scene (possibly using picture stack)<br /> - draw background<br /> - above background should place two cannons<br /> - than print wind/gravity/velocity/other data</p> <div class="code"> <pre><code>import Staging._ import Staging.{animate, wipe} cleari val im = PicShape.image(&quot;/home/alex/circle.png&quot;) // small picture about 60x60 pixels val ang=1; animate{ wipe im.rotate(ang).realDraw() line(0,0,200,200) }</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>