views:

28

answers:

1

How to draw vector objects from database in python with pygame?

A: 

I don't believe that storing all your vectors in a database is the best solution for this. I would store it in a structured file. You should abstract your design out so that your file utilities have nothing to do with your drawing. An individual object should be able to read the file, and convert the file data into the correct objects/structure to be drawn by another object.

In summary you should:

  1. Read data from storage
  2. Convert data from storage to meaningful information (datastructures/objects)
  3. Draw on the screen when the logic permits.
monksy
i should work with database. dont ask why :) anyway, thank you for suggestion.
dinamo
Reguardless, this solution is data source independent. As long as you abstract out your data source it doesn't matter where it comes from.
monksy