C
***C.Steamer***
Basically I am designing a graphical card game and I want to display the
cards around the display area in a circled form, just like you would at a
real card table. Now I have a render function render(Graphics g) and somehow
I want to be able to translate the graphics context to the points around the
circle. Trick is that I would also like to be able to deal the cards
according to the number of players and space them out equally around the
circle. Say 2 players I want to deal at bottom of screen and at
top(basically 180 degrees) and if there is say 6 players I want to deal the
cards at every say 60 degrees; So I have figured that I need to translate
the graphics context around this circle to draw each card but I don't know
how to do that. I have figured the point around the circle must represent
the center point of the card to make it look symmetrical, but I don't know
how to get the Graphics.translate() function to stop at these places so I
can draw my card. Any help would be great.
Basically I have this for code
public void render(Graphics g)
{
for(int i=0;i<playerController.getPlayerCount();i++)
{
Player player = playerController.getPlayer(i);
CardGraphic cardGraphic = new
CardGraphic(player.getLastCardPlayed());
// her i need to go g.translate(someLocation)
cardGraphic.render(g);
}
Thanks Alot
cards around the display area in a circled form, just like you would at a
real card table. Now I have a render function render(Graphics g) and somehow
I want to be able to translate the graphics context to the points around the
circle. Trick is that I would also like to be able to deal the cards
according to the number of players and space them out equally around the
circle. Say 2 players I want to deal at bottom of screen and at
top(basically 180 degrees) and if there is say 6 players I want to deal the
cards at every say 60 degrees; So I have figured that I need to translate
the graphics context around this circle to draw each card but I don't know
how to do that. I have figured the point around the circle must represent
the center point of the card to make it look symmetrical, but I don't know
how to get the Graphics.translate() function to stop at these places so I
can draw my card. Any help would be great.
Basically I have this for code
public void render(Graphics g)
{
for(int i=0;i<playerController.getPlayerCount();i++)
{
Player player = playerController.getPlayer(i);
CardGraphic cardGraphic = new
CardGraphic(player.getLastCardPlayed());
// her i need to go g.translate(someLocation)
cardGraphic.render(g);
}
Thanks Alot