Posted: Sat Oct 21, 2006 6:02 pm Post subject: Re: Huh?
maiku wrote:
I've tried re-writing my code about 4 different ways and it still doesnt want to work.
Did one of those attempts involve writing the code without using processes? That'd be my guess.
If that turns out to be the problem, I'd like to raise a big "told you so" to all those people who use processes when they should know better.
Sponsor Sponsor
maiku
Posted: Sun Oct 22, 2006 9:35 am Post subject: !
Eh!?
I never thought about not using processes... I shall try it and post my results
Cervantes
Posted: Sun Oct 22, 2006 9:55 am Post subject: (No subject)
Never thought about not using processes? You should avoid them at all costs. Read why.
bruized
Posted: Wed Nov 01, 2006 8:48 pm Post subject: (No subject)
Sorry for the lateness, but I was just wondering (and having a little problem). I tried using BSprites and it works but for some reason the white in the picture is not transparent. As an example take the example (oh so confusing ) and change the background colour to black(or anything other than white). You can see all the (or at least a lot) white pixels. Anyway to get rid of this?
maiku
Posted: Wed Nov 01, 2006 8:52 pm Post subject: yes!
yes, there is!!!
its a problem with the picture format. when ur editting the picture in paint save it as a 24 colour bit map and when ur editing, fill the entire background with bright pink first, then change it all to white.
bruized
Posted: Wed Nov 01, 2006 8:58 pm Post subject: (No subject)
Yeah, I get that it has to do with the pixels not being all pure white. But when I actually tried to do this with a few of my pictures it would show the picture just fine with transparency but as soon as I stuck it in a loop with BSprite.Change to change the picture for a blinking effect it just showed the whole entire white background.
I'll see if I can fix this some how in my program.
CodeMonkey2000
Posted: Thu Nov 30, 2006 8:51 pm Post subject: (No subject)
two procedures that feel are useful, newpic and save.
you can use these to create sprites from a sprite tree, and then save them
code:
fcn NewPic (x, y : int, px1, py1, px2, py2 : int) : int
var spriteNum : int
if upper (unused) > 0 then
spriteNum := unused (1)
for removeElement : 1 .. upper (unused) - 1
unused (removeElement) := unused (removeElement + 1)
end for
new unused, upper (unused) - 1
else
new sprite, upper (sprite) + 1
spriteNum := upper (sprite)
assert spriteNum <= MaxSprite %If error then over Max amount of Sprites
end if
sprite (spriteNum).pic := Pic.New (px1, py1, px2, py2)
assert sprite (spriteNum).pic > 0 %if error, could not find pic
sprite (spriteNum).x := x
sprite (spriteNum).y := y
sprite (spriteNum).transClr := 0 %default color of transparent color
sprite (spriteNum).mode := picMerge %Default Merge
sprite (spriteNum).background := Pic.New (0, 0, 0, 0)
Pic.SetTransparentColor (sprite (spriteNum).pic, sprite (spriteNum).transClr)
Pic.Draw (sprite (spriteNum).pic, sprite (spriteNum).x, sprite (spriteNum).y, picMerge)
result spriteNum
end NewPic
proc save (picID : int, name : string)
assert sprite (picID).pic > 0 %if error, could not find pic
Pic.Save (sprite (picID).pic, name)
end save
Nigrev
Posted: Fri Dec 01, 2006 9:39 pm Post subject: (No subject)
How do you return the value of the filename for thew sprite?
Sponsor Sponsor
CodeMonkey2000
Posted: Mon Jan 29, 2007 9:00 pm Post subject: Re: Sprites - Is There Another Way?
I don't use BSprites myself, but my friend does and he had some layering problems, a part of his picture merged into the background and this change solved all of his problems. Also if you are using 2d mapping, wouldn't it be more efficient to just update the tiles you are about to walk into/ are in?
Saveron
Posted: Sun Feb 18, 2007 5:43 pm Post subject: Re: Sprites - Is There Another Way?
I used photoshop to save the pictures and I did a bit of testing. I managed to make more of the pixels transparent but some are still not pure white, but they are off by just 1 or two on the RGB scale, one could be 254,255,254. I tink a way you can fix this is instead of making only one RGB colour transparent, make several of them transparent.
For example make everything from 250,250,250 to 255,255,255 transparent. This should fix the transparancy problem, but it would require the creator to have photoshop or similar to save the jpg at the maximum quality, paint will not work.