R0J0hound's Recent Forum Activity

  • I did a breakdown of the units of the physics behavior here:

    Basically the units that the physics library that C2 uses is based on SI units. This is the ratio of pixels to meters:

    50 pixels : 1 m

    But when you set the gravity that's in m/s^2 so you can just set it to 9.8.

  • Hi,

    It's still on my dropbox but all my links are broken because of a dropbox change. Anyways I updated the link.

  • Here's an updated capx with obj file loading.

    https://www.dropbox.com/s/dbehcd1aestt0 ... .capx?dl=0

    The obj files need to have triangulated faces, and uvs and normals in them as well. The texture files also should be flipped vertically.

    Edit:

    Another slight update: it can update the textures of tiledbg and particles as well as sprites now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's another simple library to help make webgl less verbose. Threejs or babylon3d are kind of bulky since we won't use most of it. For minimum size just webgl could be used.

  • Yeah, that's what I mean by an obj file parser. The idea would be to include an .obj file in the project and have it read all the vertices and faces from that. Anyways, that may be a while before I do something like that. I'm mostly done for the day.

  • The specific code that creates the cube is in the mycode.js file in the project files folder.

    var arrays = {
          position: [1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],
          normal:   [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],
          texcoord: [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],
          indices:  [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23],
        };[/code:3q5ffq96]
    A parser for something like the obj file format would be more manageable.
  • newt

    Probably, the loading is done with an ajax request and it can know when it fails. I'm not updating plugins now though.

  • Here's demonstration of a way to run some webgl and display the result on a sprite (not minifier friendly):

    https://www.dropbox.com/s/iq4xmleoeqkb1 ... .capx?dl=0

    It may be useful as a base to do what's asked for in the op.

  • To get it to work in preview mode with nwjs here is a strategy I've used.

    global text appfolder="c:\myfolder"

    Start of layout

    [negated] is preview

    --- set appfolder to nwjs.appfolder

    Basically, if you're in preview just use a direct folder path, otherwise use the nwjs.appfolder expression.

  • If you use the nwjs export/preview you can use the readfile expression of the nwjs object to read a local file.

    For a normal HTML preview the browser should prevent access to local files. If you export as html you should be able to access files in that same folder if you just use "nomes.txt".

  • I probably rambled too much. Maybe this is helpful?

    https://www.scirra.com/manual/141/files

  • If you added the files from inside c2 the second should work. There's also the "request project file" action.

    I said "from inside c2" because I'm not sure just adding the the files in your project folder from Windows explorer is enough. I think there's an xml file the c2 uses to list the files, but c2 takes care of that when adding the files from the editor. If you are using the editor to add the files then disregard.