R0J0hound's Recent Forum Activity

  • I’d be interested in a simple tool to create 3D games. There are unlimited features that could be added to a 3D engine, so I’m curious what minimal feature set could be to still be fun and enjoyable to use.

    Lately I’ve been less interested in flashy special case features, and more interested in simple core features that could be used to build those special case features.

    So what would such a program have? I’m sure we all have a varying list of things we would want.

    * object types: camera, 3D mesh

    * A level editor to place, size, orient said objects

    * a way to get keyboard input as a minimum

    * an event/simple scripting system to move stuff about.

    * we’d want functions and some kind of arrays at least.

    If we could access all the mesh data with expressions, even better.

    After that I have a cascading list of ideas. Lol. But those basics could be enjoyable. In that base state there would be lots of math to do stuff, but I don’t think it too bad. Simpler helper functions could be made to hide the math.

    Of course there would always be things to optimize and improve.

    The dream feature list would be:

    * editor built with same engine for ease of adding editor features.

    * a simple way to make shaders in the editor without using glsl.

    Ahh it’s fun to dream and design in your head. Kudos to anyone that takes such a dream and try’s to make such a thing for fun.

  • I don’t think anyone here wants to make a feature request.

  • There's always the feature request page if something is lacking.

    From what I’ve briefly found looking at html5, I’d probably do it the same as with my solution. Is there a built in way to restrict to only numbers? Maybe, but it’s simpler to just do myself. It gives the ability to restrict the input to anything I’d desire.

    Personally the “why” doesn’t interest me a lot. It could be an intentional design choice, or maybe oversight.

  • I think what you’re missing is sub-events. You can drag an event under and to the right of another event to make it a sub-event. Kind of like indention formatting of some programming languages.

    Hope that helps.

  • Sorry, I haven’t a clue. The plugins I mentioned were c2 only, although I think blackhornet ported paster to c3 somewhere.

    I thought you were asking about in c2.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One idea that comes to mind is to let the text box be normal and under a “text changed” condition you can check what was typed and limit it to numbers or numbers with decimals. Actually you could use float() with this too.

    textbox: on text changed
    compare: len(textbox.text)>0
    — textbox: set text to float(self.text)
  • Distorting sprites like that isn’t really possible with vanilla construct.

    One possible way could be a shader. There are many effects that people have made to distort an image. Most are pretty specific and they don’t really fit the requirement to be able to distort an image arbitrarily.

    Another idea would be to do it like texturing is done in a 3D modeling program. You’d set the position and uv coordinants of of vertecies. But again you can’t do that in vanilla construct.

    There are two plugins that can be used to do it though, with varying ease.

    The first is Paster. It has a draw quad action that can do the distortion. For curved you’d do lots of smaller quads.

    Another plugin is “custom draw.” Very similar but is simpler in a way. It’s topic has a few distortion examples.

    A third way is with some custom webgl in JavaScript to draw the distorted mesh.

  • This was reported as a C2 bug and not a C3 one. Also I think tagging the devs in posts in the bugs section is kind of redundant.

    Anyways, what's happening is the textbox object, once selected, blocks most all input events from passing through it to anything else. So the keyboard state (which is stored in a array in the keyboard object) isn't updated when the spacebar key is released.

    I'm not the developer, but you can make the keyup events not be blocked from the textbox object as a self fix. It would make the key released triggers fire as you type stuff, but perhaps that's acceptable in your case.

    Anyways, set the textbox id property to something like "foo" and then using the browser object run this code:

    start of layout
    -- browser: execute js: "$(document.getElementById('foo')).off('keyup');"

    I don't think it would work in C3 unless jquery is used in the textbox object.

    Alternatively, I guess if you wanted more control you could just do your own textbox with events and filter keyboard events yourself. Last I checked the keyboard object wasn't quite up to snuff to get typed keys with case and such, so you could capture keys with a little js as well. I thought I had posted this before, but I guess not.

    dropbox.com/s/4krzeg2umuhdeth/text_input.capx

    cheers

  • Array.asJSON, when parsed as javascript gives a dictionary with an entry with a 3d array. Do you really need to convert it?

    You could build your own array with text from the array before passing it.

    global text arrayText = ""
    every tick
    -- set arrayText to "["
    array: for each x
    -- add array.curvalue&"," to arrayText
    every tick
    -- add "]" to arrayText

    Then just pass arrayText when you call some js.

    You could also build a 1d array from it after passing it, or even just use it directly. I mean say you did:

    browser: execute js "myfunction("&array.asJSON&")"

    then in that function you'd access stuff like this:

    function myfunction(c2array)
    {
    	// access value at x=22
    	c2array.data[22][0][0];
    	// access value at x=3, y=2
    	c2array.data[3][2][0];
    	// access value at x=13, y=66, z=5
    	c2array.data[13][66][5];
    }

    Notice it's always a 3d array.

    If you want to convert the 3d array to a 3d one then just go for it. It's the standard type of thing to do when writing code.

  • Even a hidden html5 canvas will use video memory. Internally the browser is using the graphics card for basically any and all rendering.

  • Oh interesting, I didn't know "multiply" was one of the options now. It didn't used to be. I'm not sure if that would cause compatibility issues on some browsers.

    I hadn't thought of creating individual letters of different colors as needed and keeping them for later use. Probably works well when only using a limited amount of colors. If the user ended up trying to do gradual color transitions you may run out of video memory though.

    It's not bad to end a batch in c2's renderer. It does it all the time. All a batch does is it sends multiple quads using the same texture at the same time instead of separately. Besides you'd be doing your own batching of all the letters in your spritefont renderer. The only drawback is if multiple spritefont instances drawn right after each other then they could only be batched individually instead of together, but I say it doesn't matter too much.

    It seemed fun enough to try my hand at webgl again and try using my own shaders instead of working within the limits of c2's shaders and renderer. I must say webgl tutorials seem to add a lot of cruft to their code. It actually seemed fairly straightforward.

    Here I used the browser object to replace the drawGL of one instance to test stuff out. It uses it's own shader program and supplies it's own vertex,uv and color data. The only things I had to save and restore in the c2 renderer was the current shader program and arraybuffer it was using. Otherwise I tried to reuse as little as needed from the renderer, which amounted to just the view matrix.

    dropbox.com/s/52yxvilp81vii0t/custom_webgl3.capx

    Maybe that could be a useful example to use alongside a webgl tutorial.

  • We are still talking about spritefonts though, which is a quad per letter. Here the question was ways to do a different color per letter. I seem to recall c3 solved this with their updated spritefont object. This is mainly because c3's renderer adds a per quad color multiplier.

    You're probably thinking of geometry based. It's relatively simple to draw a bunch of quads. Although it's probably tedious to design or convert existing fonts over. You'd still want to use some custom webgl to do multiple quads faster and color them.

    Anyways here is a nice list of all the methods of doing text in webgl:

    stackoverflow.com/questions/25956272/better-quality-text-in-webgl