pirx's Forum Posts

  • Should be possible using the JS code feature.

    You would need to have a look at Instagram's API to check if this is supported.

  • Occasionally I also get a black screen preview. Never checked the console though as it's fixed upon restarting the prev. I'm not using any addons. I'll investigate more next time it happens.

  • Frankly speaking, now that it has been mentioned, I wouldn't be averse to a little "there are 12 events using this object/variable" additional warning text there so that we can go wut? I thought this wasn't used just in case.

  • Another two cents to confirm: This also happened to me about a week ago. Launched C3 in Chrome, opened one of my projects (Dropbox cloud open), started preview, couldn't click anything after closing the preview. Fortunately I hadn't even made any changes yet so I just assumed it was a random glitch of computer/browser/C3; restarted the browser and it hasn't happened since.

  • Good point, I'll file. Glad to help make working slouched on the sofa even easier ;)

  • I frequently work with Construct on the iPad and yes there's a couple of problems.

    Can't copy-paste an action into an empty sub-event. Sliding side panels esp. in the animation editor work wonky and tend to lock themselves in weird positions. There's the scrolling problems. C3 ran from homescreen logs me out every time I close it (yes the tick box is checked).

    I guess these are the kind of things that are going to be incrementally fixed over time.

  • Yes, I have done that and published multiple times.

    That said, I really hope C3 gets more features related to user interfaces in the future. Currently it's somewhat cumbersome to achieve simple things like scrollable menus or popup windows and it's not going to be responsive in the way a native app can be (changing layout shape and distributing objects on a grid accordingly). But still apps are absolutely possible and tutorials and examples are all out there in the forums!

  • Yeah I ended up dividing by relation between DrawingCanvas width and Snapshot width which gets the proportions in order (got that from your capx)... but that's such a random problem to have o_O.

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks dop2000, that seems to be working.

    It still however only reads pixels in a fragment of the canvas. Upon logging things to the console it seems that for some reason the snapshot has different dimensions than the DrawingCanvas?

    //dimensions of sprite and canvas after pasting sprite (x and y)
    Dimensions of picture:768 511
    dimensions of DrawingCanvas: 768 511
    //dimensions of snapshot (inside "on snapshot")
    snapshot width: 339 snapshot height:226
    
    

    Any idea why would that happen?

  • I'm making a rgb color eyedropper tool.

    The workflow is as follows:

    1. Have a picture in the form of a sprite.
    2. Set DrawingCanvas size and position to that of the sprite.
    3. Paste picture into the DrawingCanvas.
    4. Save snapshot of the DrawingCanvas.
    5. When ready, on mouse click I do "snapshotRedAt(mouse.x,mouse.y)

    That returns nothing when I click on the canvas, yet gives some readings when clicking outside the canvas which probably means that the coordinates for snapshotRedAt need to be relative?

    How do I then provide mouse coordinates for snapshotRedAt correctly in order to read pixel at that precise spot (independently of where the canvas is located in the layout?)

    thanks!

  • I'm looking to make a loop and spawn objects in a couple of rows and columns in that loop with a system->create object action. I'd like to avoid using a counter variable when I already have loopindex to work with.

    So this successfully increases the Y coordinate every 3 spawns:

    190*(round((loopindex-1)/3))

    Now how do I make X to increase 3 times and then go back to zero or 1?

    It should be different than the one for Y because Y stays the same for every 3 spawns, then increases. X should increase every spawn and then go back.

    Thanks!

  • dop2000

    Not sure if it would work in your project but another way to avoid the problem would be to ditch functions completely in this case. You could store layout specific actions in an event and trigger this event when needed ("on TriggerPixel created" or something). Passing parameters could also be accomplished via a couple temp variables. This way you could have this same exact setup in as many layouts/sheets as needed.

    Of course if there's a need to call stuff inline; recursion or other function-specific mechanics this wouldn't work but for simple scripting or just firing off actions/conditions it should be enough.

  • I'm currently making a game based almost entirely on non-linear dialogue with no plugins or addons.

    Using a pure text parser and a made up scripting language for that. I already had this game published twice using other frameworks (Corona SDK, Unity) and now remaking in C3 due to the fact that it is just faster and easier to develop; and WAY less error-prone due to how Construct does not allow for programming errors/typos to be made instead of hitting you with warnings after the fact.

    So you should be fine.

    If you want to use JSON or even an online database that's also well within Construct's capabilities.

  • no other programming languages support this

    Ashley I think what we mean is something like this

    function layout1() 
    {
    	 /* local */ function dostuff() {
    		 console.log("This is scene1!");
    	}
    	dostuff();
    }
    
    function layout2()
    {
    	 /* local */ function dostuff() {
     		console.log("This is scene2!");
     		console.log("Dostuff does something different here!");
     	}
    	dostuff();
    }
    
    

    This is a valid way to declare the same function twice (dostuff). The misunderstanding, I think, is in the fact that Layouts are not scopes in the traditional sense.

  • WackyToaster Games written in classic programming languages probably DO use same named functions that way.

    That is only possible, however, if you can make them local.

    You could, for example, easily have scene-handler functions called scene_1(), scene_2(), scene_3() ... scene_456() and if each of these had a local sub-function called identically item_arrive() that would be pretty normal.

    You would probably also twist your brain trying to make this more efficient by using things like inheritance, classes, scene instancing etc. but thankfully the reason C3 exists is to free you of all these :)