Sprite Help
Author |
Message |
Guest
|
Posted: Fri Aug 11, 2006 4:54 pm Post subject: Sprite Help |
|
|
For some reason when I use this specific Gif image, when I move it from it's original position, it get's all distorted (regardless of background). But all other gifs I tried work fine. Is there a special way to fix this such as the Pic.Merge or some method? Here is this gif then my code:
code: |
var numFrames : int := Pic.Frames ("%directory")
var pics : array 1 .. numFrames of int
var x, y := 50
var delayTime : int
var keys : array char of boolean
Pic.FileNewFrames ("%directory", pics, delayTime)
Draw.FillBox (0, 0, maxx, maxy, black)
var sprite : int
sprite := Sprite.New (pics (1))
Sprite.SetPosition (sprite, 0, 100, false)
Sprite.Show (sprite)
loop
Input.KeyDown (keys)
if keys (KEY_LEFT_ARROW) or keys ('a') then
x -= 1
elsif keys (KEY_RIGHT_ARROW) or keys ('d') then
x += 1
end if
if keys (KEY_UP_ARROW) or keys ('w') then
y += 1
elsif keys (KEY_DOWN_ARROW) or keys ('s') then
y -= 1
end if
Sprite.Animate (sprite, pics ((x div 8) mod numFrames + 1), x, y, false)
delay (3)
end loop
Sprite.Free (sprite) |
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Guest
|
Posted: Thu Aug 24, 2006 9:43 pm Post subject: (No subject) |
|
|
Any help? |
|
|
|
|
 |
[Gandalf]

|
Posted: Fri Aug 25, 2006 3:27 am Post subject: (No subject) |
|
|
Be patient? Don't double post?
As far as I've seen, certain GIF images don't work well with Turing 4.1's GIF support. Feel free to experiment on your own, though, it might be interesting to find out what causes this. |
|
|
|
|
 |
Delos

|
Posted: Fri Sep 01, 2006 3:01 pm Post subject: (No subject) |
|
|
If you're still working on this - perhaps try changing the BG colour (currently black). If you can still 'see-through' the GIF, then it's a transparency issue. Which means you should be using picCopy and not picMerge in drawing the pictures. Given that you're using Turing's Sprite.() module, you might have to do a bit of digging to figure out how to do this. |
|
|
|
|
 |
|
|