R0J0hound's Forum Posts

  • You probably need to convert the the value to a string first. The python str() function should do it.

  • RBuster

    There is a .asJson expression but it's probably to use the .imageUrl expression.

  • You can also do it with a loop. Here's an example to get the low and high x:

    global number low=0

    global number high=0

    every tick

    --- set low to infinity

    --- set high to -infinity

    for each sprite

    --- set low to min(sprite.x, low)

    --- set high to max(sprite.x, high)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Possibly, but even though I made that very effect I find it cumbersome to use.

  • Prominent

    Feel free to go for it. All my plugins/behaviors, unless I explicitly specify otherwise, can be used in games that are sold.

    In regard to the template, You could even include the plugin with it, although it would likely be better to just refer them to the plugin topic. The only requirement is I should be credited for making it.

    Basically the use is very liberal. Do anything you like with it, even modify it, just don't claim to have originally created it.

  • This topic may be of use:

    Chrome uses a color profile to adjust the colors. Or something like that.

  • I'm not sure I follow. In your example the sprite with the blend mode is on layer 0 and is covered by the objects on the other layers.

    In general a blend mode will effect everything drawn before it, or if the layer has "force own texture" then it will only affect what's already drawn on that layer.

    More complicated setups such as objects on one layer only blending with objects on other isn't possible with vanilla C2. You can use the paster object to do any complicated setup though. Just think of each paster as a layer and selectively draw stuff to it.

  • Except you can't access the same stuff you can from C2's expressions.

  • The limitation of the creature2d plugin has to do with the limits of what plugins can do in C2's editor. At runtime all the features could be used, although it takes someone interested enough to do it. Also webgl is needed for the deformations to display quickly.

    Anyway a plugin for this runtime would have the same limitations. I also stand by my original statement about the ease of making the plugin, since it's js runtime is abstracted in a complicated way that isn't directly usable like the creature2d one is.

  • To modify the source code you'll have to find where it clears. This usually means following out functions in the source. Typically it all starts in main(). This can time consuming to do but you get faster at it. Then to compile it you need Visual Studio 2008, and the directX runtime, but that is usually where people give up. Using a different version of Visual Studio has incompatibilities that would have to be changed.

    Back to your original question though you can do it with a canvas and the paste action. Basically every frame paste all the objects you want to draw. There may be features that make it easier but I don't mess with Construct Classic any more so I don't know them.

  • I don't have an example, sorry. That was just an idea. I guess you could paste a layer too.

    It's been a while since I've used cc.

  • You can't disable clearing without modifying the source code I suppose.

    Another idea is to utilize the "grab layout" (or whatever it was called) property of the canvas object. At least as I recall that's the closest feature I can think of. I'm going off memory though.

  • Prominent

    That one is intentional, well, it's just doing exactly what the html5 canvas does internally. The origin of all the drawing functions is the top/left of the canvas. The layout coordinates only match canvas coordinates when the canvas is unrotated and has it's top left at the top left of the layout.

    The only exceptions are the paste functions.

  • I guess it would probably be haelpful to expalin the formula.

    Here's a general view for one corner. P1 is the current corner and P0,P2 are the previous and next corners. "A" is the location of the player.

       A
      /
     /
    P1----P2
    |     |
    |     |
    |     |
    P0----+
    
    So next I made the obsevation that the current point (A) would only need to be created if it's in either of these two regions (b or c).
    
         .........
         .........
         bbbbbbb..
         bbbbbbb..
         bbbbbbb..
    ..cccP1---+
    ..ccc|    |
    ..ccc|    |
    ..ccc+----+
    ..ccc
    .....
    .....
    
    To calculate which region I used a vector dot product to calculate a vector projection.  That sounds more vague than it is but it looks like this. It works relative to any corner.
    
    (A-P1) dot (P0-P1) < 0 and 
    (A-P1) dot (P2-P1) > 0
    or
    (A-P1) dot (P2-P1) < 0 and
    (A-P1) dot (P1-P1) > 0
    [/code:2mpj4t2g]
    The rest was a lot of math simplification.
  • One slightly different way would be to get the angle from each imagepoint to the player and subtract from that the angle to the next imagepoint.

    Or in the simple case of a square and the imagepoints are layed out in this order:

    41

    32

    It simplifies to:

    set a to angle(Target.ImagePointX(loopindex+1),Target.ImagePointY(loopindex+1),Sprite.X,Sprite.Y) -90*loopindex

    Then if the following is true for any imagepoint you can create it.

    (-sin(a)<0 & cos(a)>0) | (cos(a)<0 & -sin(a)>0)