Hi All
So, is there a way of obtaining the physical pixel dimensions (x and y) of a sprite please?
I am trying to generate a grid of circles of ROW_COUNT and COLUMN_COUNT using the self.size function to utilise the full width of the iPad screen, such that the grid is centred correctly and not closer to one side of the screen than the other - but just can't get my head around the correct formulae.
Here's the code I am using...
# draw board (white circles) - eventually replace with image
for circles in range(COLUMN_COUNT):
for rows in range(ROW_COUNT):
new_circle = SpriteNode('shp:Circle')
new_circle.scale = 3
new_circle.position = ((circles * (x - 68) / COLUMN_COUNT) + 68, (rows * (x - 68) / ROW_COUNT) + 68)
self.add_child(new_circle)
Can any experts please shed some light and help a learner in distress please, haha... thanks.
John