<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AutoHotkey: работа с графикой, анимация]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=2731&amp;type=atom" />
	<updated>2009-01-28T17:46:21Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=2731</id>
		<entry>
			<title type="html"><![CDATA[AutoHotkey: работа с графикой, анимация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=18859#p18859" />
			<content type="html"><![CDATA[<p>Пример демонстрирует имитацию движения мяча, брошенного на пол (картинка &quot;подскакивает&quot;, а затем &quot;катится&quot;).<br /></p><div class="codebox"><pre><code>SetBatchLines -1 

Height := 600 
Width  := 960 
DiffSpeed := 0.098 
Damping := 0.995 
y := Height 
x := 0 

Gui, Add, Picture, x96 y20 w23 h15 vBalltext Icon1 ,C:\windows\notepad.exe
Gui, Add, Button, x16 y20 w50 h20 gDropping, Drop 
Gui, Add, Button, x16 y50 w50 h20 gStop, Stop 
Gui, Show, x10 y10 h%Height% w%Width%, Gravity Testing 
Return 

GuiClose: 
ExitApp 

Stop: 
SetTimer, falling, off 
GuiControl, Move, Balltext, x96 y20 
return 

Dropping: 
speed := 0.0 
x := 0 
y := Height - 40 
SetTimer, falling, 10 
return 


falling: 
x += 0.5 
If (y &lt; 0) { 
  y *= -1.0 
  speed := Abs(Speed) 
  } 
speed -= DiffSpeed 

y += speed 
y *= Damping 
yposition := (y &lt; 2) ? Height - 20 : Height - y - 20 
xposition := x + 96 
If (xposition &gt; Width-20) 
  Goto Stop 
GuiControl, Move, Balltext, x%xposition% y%yposition% 
return</code></pre></div><p>Пример опубликовал <strong>LEXYS</strong>.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2009-01-28T17:46:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=18859#p18859</id>
		</entry>
</feed>
