Random images

Hi again, so how can i put a random image from a table, and compare that image with another one.
I hope you can help me.

Bad english, i know :smile:

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2015

    Change attribute self.Image to tableCellValue(tableName,random(1,tableRowCount(tableName)),col). Make sure column 1 of the table is set to "text" and that you have typed in a text string in each row that matches the image filename (for example, if the filename is dragon.png then you would type "dragon" into the table cell without the quotes).

    Are you wanting to compare the images of two different actors to see if they are the same?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • WalaskyWalasky Member Posts: 10

    ooh i see, and yes, i have to compare two images, if i touch the same image do something.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Then you need to store each actor's self.Image value in two different game attributes that are text attributes.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • WalaskyWalasky Member Posts: 10

    ok, let me try it, thanks a lot.

  • WalaskyWalasky Member Posts: 10
    edited April 2015

    @tatiang i could make the random pick from the table, but i can't compare an image and a value from the table, like a match game.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @Walasky said:
    tatiang i could make the random pick from the table, but i can't compare an image and a value from the table, like a match game.

    Why not? How did you try to do it? This should work:

    If attribute self.Image = tableCellValue(tableName,row,col)

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • WalaskyWalasky Member Posts: 10

    it works, thanks for help, and sorry about my newby questions :smile: , thanks a lot

Sign In or Register to comment.