Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

how to "attach" an image to a javascript object?

edited February 2015 in Help! with 1.x
i looked at sharpes guide on javascript objects and was wondering,how do i attach/assign an image to a object????using sugarcane.
:-\

Comments

  • What are you trying to accomplish?
  • something like this:

    <<set $card {}>>

    <<set $card1 {
        image: [img[blankcard]]
    }>>

    <<set $card = $card1>>

    of that does not work  ??? ??? ???
    i'am trying to make a simple card game you see.
  • You cannot do that.  What you can do, however, is to record the image's source path/passage instead, which amounts to much the same thing.

    For example:

    <<set $card to {}>>

    <<set $card1 to {
    image : "blankcard"
    }>>

    <<set $card to $card1>>

    [img[$card.image]]
Sign In or Register to comment.