Ian Mallett wrote:
That's why I put it in reverse order.
I'm assuming you're replying to my comment. The algorithm is still
wrong: i % j is 0 if i is a multiple of j, not if the last digit of i is
j. Your scheme yields the wrong answer if the frame number is bigger
than 10:
def frame(i)
> I'm assuming you're replying to my comment.
Yes.
Anyway, it was psudocode. You're probably right.
I'm sort of doing it a big differently, right now I'm just testing, but I
can tell if my mouse position is in the second square block like so:
elif event.type == pygame.MOUSEBUTTONDOWN:
print pygame.mouse.get_pos() + (25,25)
print MAP.blocks[
Whups major flaw forgot to check if the height also.
On 9/13/07, Lamonte(Scheols/Demonic) <[EMAIL PROTECTED]> wrote:
>
> I'm sort of doing it a big differently, right now I'm just testing, but I
> can tell if my mouse position is in the second square block like so:
>
> elif event.t
elif event.type == pygame.MOUSEBUTTONDOWN:
print pygame.mouse.get_pos() + (25,25)
print MAP.blocks[2].point
mouse = pygame.mouse.get_pos()
rng = mouse[0] - MAP.blocks[2].point[0]
rng2
Luke Paireepinart wrote:
But this is per-pixel alpha, which is slower than colorkey transparency,
I believe.
In theory it may be, but I haven't found this to be a
problem. As a benefit, you get better-looking results
due to anti-aliasing of the edges (assuming your alpha
channel has been create
Ian Mallett wrote:
I do it by filling in the transparent areas
black, and using an option in psp6 (my paint program) to make those
areas transparent. Then I save that to the alpha channel and save the
file as a .png. So is that per-pixel?
Technically, yes, but if it means there are no parti
Ian Mallett wrote:
if frame_number%10 == 0: #frame_number is a multiple of ten
#draw frame 1
elif frame_number%9 == 0: #frame_number ends in 9
#draw frame 2
elif frame_number%9 == 0: #frame_number ends in 8
#draw frame 3
> ...
Were there supposed to be different numbers in that? :-)
Also
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Greg Ewing wrote:
> Luke Paireepinart wrote:
>> But this is per-pixel alpha, which is slower than colorkey
>> transparency, I believe.
>
> In theory it may be, but I haven't found this to be a
> problem. As a benefit, you get better-looking results
>
Luke Paireepinart wrote:
Yeah, I believe PNG's alpha channels are per-pixel.
They are.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zealand | (I'm not a morn
Lamonte Harris wrote:
elif event.type == pygame.MOUSEBUTTONDOWN:
print pygame.mouse.get_pos() + (25,25)
As DR0ID said, you should be able to get the mouse position from the event.
print MAP.blocks[2].point
mouse = pygam
Lamonte Harris wrote:
So I was thinking if I made an invisible rect that moved when the mouse
moved then I left clicked and it would get the current surface position
of the rect, then it would run a function to see if that current
position matches any of the map squares at the bottom of the scr
http://www.powells.com/biblio/63-9780596001889-7 Used, has anyone read this
book. Any additional information that you like,dislike about this book? [I
like having real books and stead of ebooks because its better on the eyes.]
Should be her 2morrow Afternoon :), few hours before I get home great
Lamonte(Scheols/Demonic) wrote:
elif event.type == pygame.MOUSEBUTTONDOWN:
...
mouse = pygame.mouse.get_pos()
It's better to get the mouse position from the event,
seeing as you've got one, than to use mouse.get_pos().
Then you can be sure
Lamonte Harris wrote:
Whups major flaw forgot to check if the height also.
Check out the collidepoint() method of the Rect class.
It'll check both coordinates for you in one go.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, |
Ethan Glasser-Camp wrote:
If there were a convert() function that changed
fully-transparent alpha into a colorkey, I would use that;
Probably you could just throw away the alpha channel
and use the colour of the top left pixel as the
colorkey.
--
Greg Ewing, Computer Science Dept, +---
I haven't read this book, but I'm usually wary of the "nutshell" type books
or "learn some language in 7 days!" type books. Just make sure you check out
the Tutorial on python.org because that is very thorough, and the book might
just teach some neater things Python can do that you might not instan
Hi
Perhaps you should write a convert script that removes the alphachannel
and replaces it with a colorkey of your choice. The main problem will be
what do you do with half transparent pixels? e.g. pixel where the alpha
value is between 0 and 255.
From the set_alpha() documentation:
"If the
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
DR0ID wrote:
> Perhaps you should write a convert script that removes the alphachannel
> and replaces it with a colorkey of your choice. The main problem will be
> what do you do with half transparent pixels? e.g. pixel where the alpha
> value is betwe
19 matches
Mail list logo