R0J0hound's Recent Forum Activity

  • dop2000

    You can specify the font, i don't know if web fonts have any special handling besides that.

  • You could do a star field with the achievement text zooming in. Frustratingly enough setting the size of the text object changes the text area and not the visual scale. I could change the font size dynamically but that probably is inefficient methinks. So I just used a bit of javascript to generate an image with the text and load that into a sprite.

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

    Another idea is to have the text scale as if the lines were being scaled on a cylinder.

    The star wars marquee should be doable with a shader i think. It's just a perspective transform. You could also scale them like that as well.

  • Use c2_callFunction is to call a C2 function from javascript

    Use Browser.execJs() to call a javascript function from c2. It just calls the javascript eval() function.

    1. Typically in a plugin, but you can put it anywhere you like.

    2. Just like in the manual. If the C2 function you want to call is named "foo", you'd call it with c2_callFunction("foo", []);

    3. Use the "set return value" in the "foo" function.

    You probably just want to use the Browser object to call javascript if i understand you correctly.

    Set variable_a to Browser.ExecJS(variable_a&"*2")

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There is a difference.

    Here are the ways to run a javascript file other than putting it in script tags. Note that "import" isn't available in older javascript engines.

    https://stackoverflow.com/questions/950 ... cript-file

    As long as you load from a file they will mostly behave the same, although if the load is done via the execute javascript action the file will load asynchronously so it won't be able to run right away.

    If you put code directly in the action that you want to run later, you'll run into scope issues. Basically any var or function will be local instead of global as when run from a file. You can get around that by putting them inside a global variable. For example instead of

    var foo=33;

    you could use

    window.foo=33;

    Then you can use foo any time later.

    Of course in nwjs exports there is no global window object so you'll have to get the global object some other way. Isn't javascript fun?

  • No, not automatically.

    Your choices are to either rewrite you game in some other tool or language that can be exported to an apk, which is the most reasonable solution, or...

    Porting the CC runtime to run as a apk.

    The source is available but it takes visual studio to build and is dependent on windows components: directX, xaudio and the winapi. It also is dependent on some x86 assembly for things like the per-pixel collision detection. So the things that would need to change is: making it use opengles instead of directx, use andriod features instead of xaudio and the winapi, and rewriting the assembly from x86 to arm assembly or C++. On top of that there are other Visual studio specific things that would need to be changed so it can be compiled with gcc.

    More reasonably you could just make your own runtime any way you want, and use something like capreader.py (a tool i made to get at all the insides of a cap file). This is still a fair amount of work. I haven't found such a thing worth the effort.

    You possibly could use capreader.py to get the layouts of your game at the very least.

  • Make the magnitude of the force proportionate to the speed.

    apply force at angle of motion with magnitude -speed*number

    where number is the strength of the force

  • I can’t read the image you posted of the error, but it’s probably the same known error that you get when creating and destroying too many physics objects.

  • They add dll files needed by the runtime to run. Without them you'd get an error.

    That said, not all the dll in the redistributes are needed. You can look at your game exe with something like "dependency walker" to see all the dlls it uses. Notably the dx vs dlls are the one's you could bundle. Unless of course those dlls need some other dll.

    Try this:

    Put your game on a machine where you haven't installed those redists (hopefully nothing else has already or you'll miss stuff). Next, try and run the game and it will complain about a missing dll. Find that dll on another machine you have already installed the redists on, and copy it over to the same folder as your game. Then try running the game again and repeat till the game runs. All the dlls you copied over should be all you need to bundle with your game to run without the redists.

  • It’s not really a workaround, it’s JavaScript that usually is in a plugin. Also it is possible to get the image from other objects if we tap into the runtime functions. It will no longer work when minifying though, and it’s a bit complex as there are many more edge cases to handle. At that point why not just use the canvas plugin?

  • This is probably off from the direction you're going but here is a way to get the pixels of an image without the canvas plugin.

    https://www.dropbox.com/s/soijvpnt8vjkc ... .capx?dl=1

    It actually just gets the alpha as in transparent 0 or not 1. Every line is separated by a newline.

    It could be modified to give a width and height then a list of pixels but as is is fine imo.

    Anyways it may be useful to someone. To make it work with C3 all that should be needed is to replace 'c2_callFunction' with 'c3_callFunction' in the js file in the files folder.

  • JohnnySix

    Someone could make a plugin i suppose, but using exec javascript still works here. What's the error? If you open up the browser console you should see what the javascript error is. However copy pasting what I posted here works fine.

  • Cool

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound