jbar6381's Recent Forum Activity

  • Hi,

    I have blank sprites that load an image from local directory. I have done this with the following:

    FileChooser On changed | System Set NewImage to FileChooser.FileURLAt(0)[/code:2a3tspib], where NewImage is a variable. 
    
    Then I did:
    
    [code:2a3tspib]
    System | Create object CustomImage1 on layer 0 at (0,0) 
    CustomImage1 | Load image from NewImage (Resize to image size)
    [/code:2a3tspib], where CustomImage1 is the name of the sprite. 
    
    I want to load the sprites with their respective images everytime I load the app. So I stored the CustomImage[1-5] variables into LocalStorage like so:
    
    [code:2a3tspib]
    LocalStorage | Set item "CustomImage1" to NewImage
    [/code:2a3tspib]
    
    I then try to restore the image like so when I reload the app:
    
    [code:2a3tspib]
    System On Start of layout | LocalStorage Check item "CustomImage1" exists
    LocalStorage on item "CustomImage1" exists | LocalStorage Get item "CustomImage1"
    LocalStorage on item "CustomImage1" is missing | LocalStorage Set item "CustomImage1" to ""
    LocalStorage on item "CustomImage1" get | System set "CustomImage1" to LocalStorage.ItemValue
    [/code:2a3tspib]
    
    However, I believe that I'm having problems reloading these images because  the URL is only retained in memory during a session and is not permanent. Is there a way I can achieve what I want to do which is to load images into sprites dynamically and make them persistent across reloads (sessions)?
  • HI TMsimonW, thank you very much for your reply! I didn't release there was a setting for the collision polygon. I assumed it was the bounding box. Thanks for letting me know about collision polygons.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Problem Description

    I’m using sprites as buttons, and would like them to toggle based on whether they are touched or not, which shows whether they are selected or not.

    Sprite buttons intermittently do not recognise the touch event.

    Attach a Capx

    https://dl.dropboxusercontent.com/u/527 ... tShop.capx

    Description of Capx

    The capx file contains a few images of png format because they have transparent backgrounds. The shop and the sprite buttons.

    There are two types of sprite buttons, one is an animation and the other is just a single image that gets destroyed and created on touch.

    When a sprite button is clicked it toggles to the selected mode which is either animation frame 1, or a second image.

    I tried these two methods to see if it was the animation that was faulty.

    Steps to Reproduce Bug

    • Click on the glasses sprite button
    • Click on the no glasses button
    • Keep repeating this and you will notice that sometimes they do not toggle to selected Observed Result Sometimes the sprite button does not recognise the touch event and so does not toggle to selected. Expected Result When sprite button is touched, they toggle to selected, on every touch event. Affected Browsers
      • Chrome: (YES)
      • FireFox: (?)
      • Internet Explorer: (YES)

    Operating System and Service Pack

    Win 7 home premium sp 1

    Construct 2 Version ID

    Release 216

  • Thank you very much OddConfection and The key was to have the System > On start of layout repeat the assignment of the global variable text to the text object.

  • I have a global variable for the text to set the Text Object's value. It still doesn't work.

    This is my set up:

    * Layout 1 & Layout 1 Event Sheet - two buttons; button 1 calls a function called "update" in the Function Event Sheet, button 2 goes to Layout 2.

    - a global variable initialised to 0.

    - a text object that is set to the global variable value.

    * Function Event Sheet - has a function called "update" which increments the global variable by 1.

    * Layout 2 & Layout 2 Event Sheet - has two buttons; button 1 calls a function called "update" in the Function Event Sheet, button 2 goes to Layout 1.

    Result:

    Layout 1 sets the text value to the global variable value correctly, but not Layout 2.

    A click of button 1 on Layout 1 updates the text object to a value of "1".

    Once we click to go to Layout 2 and press the button to update the global variable, then go back to layout 1, the text object has a value of "Text".

    A press of button 1 on Layout 1 updates the global variable to "2".

  • I have a text object in my main layout (Let's call this A), and I have a second layout (B) that opens up from the main layout (A) via a button click. I want to alter the text object in (A) when I change settings on (B). How do I do this without databases? Is this possible?

jbar6381's avatar

jbar6381

Member since 19 May, 2014

None one is following jbar6381 yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies