How do I make my code show an image from tables?

TeslaXTeslaX Member Posts: 8
edited July 2012 in Working with GS (Mac)
Does anyone have the project files form the 0.9.90 webinar? or know where I can get it? I am trying to do a picture game and pull the images from tables, but I have never displayed anything but text from tables before. In the webinar he did this very dynamically, I would like to use this same method!

Does this at the 34min mark:

http://www.youtube.com/watch?feature=player_embedded&v=8ghHVTwm2X8

Best Answers

Answers

  • ericzingelerericzingeler Member Posts: 334
    with change attribute you can assign an image name to the self.image attribute. The name of the image can come from a table cell (text).
    In detail:

    Change attribute self.Image = tableCellValue(mytable,1,1) (Table Name, row, column)

    Cell 1,1 in mytable = ImageName

    Also, if your working with a prototype actor and have multiple images that are specific to an instance of that actor, and want to save a lot of time. Do something like this:

    Place your actor instances in a layer that holds only that type of actor (for organization purposes only). Then rename each instance to a integer such as 1, 2, 3, ... Use the name attribute of that actor to link a cell in a table. ex: self.image = tableCellValue (mytable, 1, self.name). Now, list all of the image names that pertain to an actor instance in the column of the actor name.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Don't forget to add .png to the name.
Sign In or Register to comment.