Loading a Sprite Image from a File via Events

Get help using Construct 2

Post » Thu Jan 16, 2014 11:13 pm

Hi all,

Just a quick newbie question. Right now I have five different sprite images in five different files (as opposed to a sheet) in the same folder as the project file, and I'm trying to make a Sprite change from one of the picture files to another using the event/action system. I've already tried the following with no success:


    sprite | Set animation to "filename.jpg" (play from beginning)
    sprite | Set animation to "./filename.jpg" (play from beginning)
    sprite | Set animation to ".//filename.jpg" (play from beginning)
    sprite | Load image from "filename.jpg" (Keep current size)
    sprite | Load image from "./filename.jpg" (Keep current size)
    sprite | Load image from ".//filename.jpg" (Keep current size)


My current hypothesis is that I might need to add the files to the "Project" window tab under the "Files" subfolder first. Worst case I can throw all the images into a sheet and use those related commands, but I was trying to keep things "simple" (in my opinion at least...). Thanks in advance for any advice!
B
3
Posts: 4
Reputation: 183

Post » Fri Jan 17, 2014 9:48 pm

Fixed! Imported the files and now the Sprites change with the line:

sprite | Load image from "filename.jpg" (Keep current size)
B
3
Posts: 4
Reputation: 183


Return to How do I....?

Who is online

Users browsing this forum: Fradno and 14 guests