tags:

views:

77

answers:

5

I've just started to learn pygame, and it pretty much needs some coordinates and points in the code in order to position the object. Do you know of any tool or application that I could use as a reference so that I could see a visual representation of the points. Maybe a grid with numbers. And pygame also includes declaring the color by using numbers. Do you know of any site or application that I can use as reference to those numbers and corresponding color. Like this one: 230, 170, 0 And what do these numbers mean. I'm using windows operating system.

+1  A: 

In Pygame, co-ordinates work as (x,y) offset from the top left, I believe (where to-the-right is positive on the x-scale, and towards-the-bottom is postive on the y-scale). This is done in number of Pixels. After I had used Pygame for a few days, I was able to guess what the x and y values were that I wanted, and I was always pretty close. It just takes a bit of getting used to.

Those numbers for colour are RGB values. You can find more information about that here. Again, once you get used to using it, you can generally have a pretty good guess at the colour you're after. If you're after a very specific colour, you can open up Microsoft Paint, and select a custom colour by double-clicking on one of the colours in your palette. Then click "Define Custom Colours >>" and pick your colour. It shows you the RGB values there (R is red, G is Green, B is Blue).

If what I've said doesn't make sense to you, please ask for clarification :-)

Smashery
+1  A: 

You don't need a grid to help you, you just need to know the origin point (easy - it is one of the corners). Since it is all interpreted, I say you just hack around displaying stuff on the screen till it clicks in your head.

The other part is easy. It is Red, Blue, Green (each one goes from 0-255, 0 is no-color, 255 is full-color).

Austin Kelley Way
A: 

color helper: http://www.pangloss.com/seidel/ClrHlpr/color.html

As for the x,y coordinates. It can get pretty complicated. I recommend doing some eyeballing like the others suggested. However, if you need something more precise, you will need to get your hands dirty. I wrote a level editor for a game design course you can find here: tstechonline.com/edward/tiles/EdwardLevelEditor.html

The basic idea is that the drag and drop interface is converted to a text file which represents the screen as a grid. Each tile is 40x40 pixels and is represented by a letter in the output file. You will need some sort of gui -> text converter tool like this to help you if you need something more precise than eyeballing.

Hope this helps.

JGord
A: 

You have to get used to imagine where a point is by is coordinates. It isn't difficult: the (0, 0) point is the top-left corner and the first value represents the horizontal distance in pixel from the left side of the window and the second value represents the distance from the top of the window. And if you make a mistake you can correct it in few seconds.

This is a colors calculator: Color calculator

If you use Notepad++ as editor there is a color picker plug-in: sourceforge.net/projects/npp-plugins/files/

Francesco Pasa
A: 

just print the (x,y) coordinates in the mouse motion event. i.e. every time mouse moves. for colors you can also use Microsoft Paint.

More generally, you can try to have a look at this series of tutorials on YouTube

http://www.youtube.com/phyces

for pygame, dealing with positions and colors. He doesn't go into it in great detail, but maybe you can pick it up from the way he is using it. The videos could be instructive in general if you are just starting out.

karpathy