Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to update the location of an image?

I'm currently calling my image dynamically using:

itemImage = display.newImage(inventory[t.ID][1])

t. being my target ID.

But in order for Storyboard to properly work, I need to change its location in my code to above my function, rendering its dynamic properties useless. Is there a way to update it like you can do with .text?

something along the lines of:



share|improve this question

No. You have two options.

Firstly, you can remove the image and then request the next one.

itemImage = nil
local myOtherImage = display.newImageRect()

If you call the old image again later, this is fine as the images are cached by Corona.

Secondly, you can use an image sheet:

itemImage = nil
local myOtherImage = display.newImageRect(imageSheet, frame, width, height)

This allows you to pull images from an efficiently packed image sheet.

I must admit I don't fully understand what you are trying to accomplish. There is no reason you should be struggling with this and storyboard. Perhaps post a few more details with the specific problem.

As a side note, you should try and use newImageRect as this allows for scaling:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.