nagyv's Forum Posts

  • :) allez les bleux!

  • endel I totall agree with you about the dev experience provided by Construct. That's why I try to separate addon development as much from C3 as possible, and provide a thin and well defined layer of interaction between C3 and my addon.

    E.g. I've decided to create my UI elements with React on top of C3, because it's fun to work with React, I can develop all the required interactions there, and have some simple, well defined methods to communicate between React and C3.

  • I would like to use some images from the DOM using a custom plugin. I see that the images will be exported, and I can reference those urls once I export the project. Now, I would like to see the images in preview mode too.

    I've found the AssetManager documentation, but don't know how to use it. Is it possible to access it from a `DOMElementHandler` instance or only from worker threads?

    Once accessed, can I access "Tiled backgrounds" with it or only Project Files under the "Files" folder?

    Tagged:

  • Hi guys!

    I know that the docs were far from perfect a few months ago. Run into issues with it as well. :)

    Anyway, I have a working prototype with React.

    If you would be interested, check out the example project at dropbox.com/s/u0nie14z67a99ar/ReactPluginExample.c3p

    or the github repo: github.com/nagyv/c3-reactpluginexample

    This example shows the React app to be instantiable, but actually, I plan to run a single react app for a given layout. This way I can cover the whole UI with it, no black bars on the sides. :)

  • Thanks for your post!

    I was thinking about this too. Have been playing a bit with the HTML Element addon, and quicky found some bugs there. I don't think it's ready for production.

    First, of all, I'm not speaking about the backend side. I'm mostly concerned about the best frontend approach possible. Given amazing tools like React and Preact, I would prefer to generate my non-canvas related UI code with these tools, have some messaging feature between the DOM and canvas / plugins, and run the (strictly speaking) game with Construct.

    Now, I looking into the Inject CSS plugin a bit more, as I've found it pretty reliable. Currently, I plan to use Inject CSS to

    1. create a div that I can use as the main container for UI elements

    2. attach an ID to the canvas created by Construct

    3. at start hide the canvas using css, loaded by Inject CSS

    This way I can provide the non-game UI inside Construct, but without Construct.

    Until now, this is only a plan. I'll see how it works out in the next few weeks. My major concerns are UI elements that I might want to position on top of the canvas during gameplay. To position these elements, I'll need the canvas offset and size, and start playing with absolute positioning of the HTML elements. Will see how it works out!

  • Hi,

    I'm developing a full-fledged website to support my game. Including all kinds of views from login/registration, leaderboards, chat, etc. Basically, the game itself is just a component on a page.

    I would prefer to integrate deeply the game into the overall webpage. By this I mean, to have the login and all the details listed before handled by a proper web framework and have Construct to run only the game (it's a board game, like chess). How would you integrate such a setup with a Construct3 game?

    Tagged:

  • Hi,

    I've started to work on a simple cli to help addon development.

    Currently it supports:

    - starting a new plugin

    - adding a new action, condition or expression to a plugin

    I've plans to extend it with behaviour and effect management as well. Moreover, the current solution only adds the json part of an action/condition/expression, no boilerplate js is generated. I might add it as well.

    Try it out! :)

    Start a new plugin

    $ npx c3-addon-cli init Myplugin
    

    After answering a series of question, you got a plugin working in developer mode.

    Extend your plugin

    $ cd Myplugin
    $ npx c3-addon-cli addAction myAction
    

    To add a new action to your plugin.

    Publish your plugin

    $ npm run build
    

    This packages your plugin into a c3addon file that can be published at construct.net.

    For more info, check it out at: github.com/nagyv/c3-addon-cli

    PRs are welcome! :)

  • Obvious. :)

    Thanks!

  • Hi,

    The "Instant games" plugin has an "Is available" condition to check if we run on Instant games. How can I find out that I'm running in NW.js / Browser / Mobile?

    Why?

    In case of browser, the browser's language detection is perfect.

    In case of NW.js, the language seems not to be detected (my OS language is Hungarian, but Browser.language returns English in NW.js. Thus I would like to show a language selector if run in NW.js.

    As I develop the game, I would like to export it to mobile too, and might need platform specific code there as well.

    The question again: How can I find out that I'm running in NW.js / Browser / Mobile?

  • Yeah, I've noticed your name too. Fixed it already.

    Thanks for the link!

  • Hi,

    this thread is to discuss issues concerning the internationalization plugin c3-i18next https://www.construct.net/en/make-games/addons/249/c3-i18next.

    If you like the plugin, please consider supporting my work at Patreon https://www.patreon.com/nagyv

  • I have the solution. In the sprite editor one can define the sprite's collision position. It seems that the collision field is actually the touchable area too.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There is no priority of tiles. You are free to move to both tiles.

    I've been googleing around to figure out how to read the color from the canvas. As it seems that Construct3 uses webgl2 type canvas, this is to work: stackoverflow.com/questions/44070167/get-color-at-position-webgl

    Unfortunately, it does not.

    I've figured out that Touch.X and Touch.Y will give me the correct positions, but still no luck.

    in the preview console I've been trying the following, but in the end I did not get the expected results:

    ```

    var a = $("mycanvas") // I don't know where $ come from, but it's defined :)

    var b = a.getContext("webgl2")

    var pixels = new Uint8Array(4)

    b.readPixels(318, 498, 1, 1, b.RGBA, b.UNSIGNED_BYTE, pixels)

    ```

    This should set pixels to the rgba values I need, but it's not set. :(

    Any ideas how to read the color from the canvas?

  • this won't work for me unfortunately as there is no priority between to white or green, it was just as an example to show my problem.

    Looking at the whole field I have, I have many overlapping sprites, and there is no priority between them (imagine a chess board with non-square fields).

    Is there a way I can detect the color below the touch point? I could try to figure out from that the sprite that I'm interested in. (I have 6 different colors, I know their RGB codes.)

  • I've slightly modified to event sheet to get everything logged properly.

    The logs show that both fields are selected. (There is a Field found message for both ids.) But the "Moving to position" message is called only by the "1st" field. Similarly, my `Move` function is called only once with the "1st" field's data.

    For some reason the image of my modified event sheet did not upload. You can find it here: dropbox.com/s/a8ykgu95ho31rro/Screenshot_2019-03-06%20Construct%203%20r136%20%E2%98%85%E2%98%85%E2%98%85%E2%98%85%E2%98%85.png