Search found 6 matches

by 10c8
Fri Apr 27, 2018 4:04 am
Forum: Support and Development
Topic: Two objects with the same rotation look slightly offset
Replies: 2
Views: 2266

Re: Two objects with the same rotation look slightly offset

The correct pivot point of the glow image is probably not self.xpivot, self.ypivot, since that's the card's pivot point. Find the right pivot of the glow image, and draw both the card and the glow at the same coordinates x, y. You have not posted the code for calculating self.xpivot and self.ypivot...
by 10c8
Thu Apr 26, 2018 9:44 pm
Forum: Support and Development
Topic: Two objects with the same rotation look slightly offset
Replies: 2
Views: 2266

Two objects with the same rotation look slightly offset

Hello, I'm currently working on a card game. The player's hand is drawn as a fan of cards. I'm trying to make a card glow when it is playable by drawing a slightly bigger (correctly offset) glow image, and this works just fine when the card isn't at an angle: Captura de tela de 2018-04-26 18-38-45.p...
by 10c8
Wed Apr 25, 2018 7:51 pm
Forum: Support and Development
Topic: Layered mouse collision
Replies: 7
Views: 5239

Re: Layered mouse collision

I tried your code and this happens: It only seems to detect a collision correctly when there's a single card (with almost no rotation): It seems to depend on the angle of the card. Nevermind, your code assumes that the card rotates counter-clockwise with the angle, but they rotate clockwise . So I ...
by 10c8
Wed Apr 25, 2018 7:47 pm
Forum: Support and Development
Topic: Layered mouse collision
Replies: 7
Views: 5239

Re: Layered mouse collision

I tried your code and this happens:
Captura de tela de 2018-04-25 16-42-35.png
Captura de tela de 2018-04-25 16-42-35.png (91.79 KiB) Viewed 5205 times
It only seems to detect a collision correctly when there's a single card (with almost no rotation):
Captura de tela de 2018-04-25 16-44-09.png
Captura de tela de 2018-04-25 16-44-09.png (22.75 KiB) Viewed 5205 times
Captura de tela de 2018-04-25 16-44-26.png
Captura de tela de 2018-04-25 16-44-26.png (15.57 KiB) Viewed 5205 times
It seems to depend on the angle of the card.
by 10c8
Wed Apr 25, 2018 6:23 pm
Forum: Support and Development
Topic: Layered mouse collision
Replies: 7
Views: 5239

Re: Layered mouse collision

Thanks! By the way, how would I go about doing those calculations when the origin is the bottom-center (0.5, 1)?
by 10c8
Wed Apr 25, 2018 5:16 pm
Forum: Support and Development
Topic: Layered mouse collision
Replies: 7
Views: 5239

Layered mouse collision

Hey, I'm currently working on a card game. On the screen, each player's hand is drawn as a fan of cards (image below), where cards may slightly overlap each other, this means that by simply checking if the mouse is within each card's rectangle sometimes returns more than one card. I figured I could ...