matriax's Recent Forum Activity

  • Here is an idea - set "Blend mode=source atop" for buildings and use tilemap as a mask. (and also as a solid surface for tanks)

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

    Oh! The source Atop do the job well, thanks <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    But i not understand why you dfill the objects in that way, is more faster/optimized after in runtime than this?:

    https://cdn.pbrd.co/images/GXI2AX5.png

    Ok, so now only the sprites with alpha left, so i guess in this case is use the canvas plugin to detect the alpha and erase the tiles with them or rework the tiles addition to run all coordinates in the canvas an set 1 tile in the tilemap for the ones that not have alpha, i don't know wich one will be better. BTW, i guess if after run i can save it as .json as described and load fast i think no matter.

    PD: dop2000 i bought you a coffe, i think, i don't know how much cost in australia XD

  • Well just get it for Rectangular objects

    Wonder how get for the ones with alpha mmm...

    EDIT: One idea is paste that layer object into your canvas plugin and get the RGBA and detect if have alpha > remove tile. But i guess this means do an arrays that test all the pixels in the canvas looking for the alpha ones. Mmm, i will try later.

  • I'm doing a prototype trying pixel destruction and this is just what i need.

    R0J0hound Is there any way to add an sprite in the layout and when the layout starts make the tilemap adds tiles there?

    Or maybe other way to build a terrain using just sprites and on runtime add tiles in the tilemap so you can make any kind of terrain easily.

    I made a fake destruction pixel using the DestinationOUT blend

    The idea was then make if collides with building and is not overlaping one of the bullets with destinationOUT explode so you can make holes , but is not pixel precise and perfomance drops when losts of bullets blends , but well as first aproach was interesting .

    So, my idea is add a sprite, on runtime set tiles from tilemap there and use the destinationOUT to make the sprite looks destroyed equal i did for the blue buildings in the gif. But can't find a way to achieve the first step :S

  • This code edit the RGB values of the overall image

    varying mediump vec2 vTex;
    uniform lowp sampler2D samplerFront;
    uniform lowp float red;
    uniform lowp float green;
    uniform lowp float blue;
    
    void main(void)
    {
    	lowp vec4 front = texture2D(samplerFront, vTex);
    	
    	gl_FragColor = front * vec4(red, green, blue, 1.0);
    }[/code:1q7tkhkd]
    
    To work as Highlights/Midtones/Shadows RGB correction needs 9 properties, 3 RGB for each one:
    
    [Highlights] Modify the RGB values with 255-170 of light
    Highlights RED
    Highlights GREEN
    Highlights BLUE
    
    [Midtones] Modify the RGB values with 170-85 of light
    Midtones RED
    Midtones GREEN
    Midtones BLUE
    
    [Shadows] Modify the RGB values with 85-0 of light
    Shadows RED
    Shadows GREEN
    Shadows BLUE
    
    I don't know how explain, trying to find some page that explain how exactly works, but the idea is the same as the code posted but to works separated on the highlit, midtones and shadow zones of the image. So, i guess does something like that.
    
    Any idea?
  • MadSpy Thanks! worked!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can take a snapshot and then use the "invoke download" action and give the "CanvasSnapshot" on url and the filename.

    But the "invoke download" shows a dialog to save the file.

    The idea is simpy press "S" for example and take a snapshot and save automatically as Snapshot001.png in a folder. I'm trying to do a Batch processing so giving 10 image files(Using file chooser) and apply X effects and then save as image01.png, image02.png ,etc...

    So i tried this:

    On press the key, the file test.png is automatically created with 240kb, i try to open but says is not a .PNG file. I opened in a text editor and compare with an other .PNG file and looks very similar, so i guess there is something i'm missing.

    How to fix it?

  • I saw there is a "ID (Optional)" property in the left pad of the plugin for CSS style but i can figure how call from CSS style and change the text in the button or whatever.

  • With the plugin button you can configure the text but with the file chooser not, so appears this:

    I guess to change that have to be using the CSS style action but how to know which atributes are or how? Any doc? I read the Button/Text manual and appears this:

    [quote:34shgf6a]Make the text red: Set "color" to "red"

    Make the background yellow: Set "background-color" to "yellow"

    Make the border a thick light grey: Set "border" to "3px solid #AAAAAA"

    Make the font bigger: Set "font-size" to "2em"

    Make a dashed red border: Set "border" to "2px dashed red"

    But that plugins have the change text on their properties but no file chooser. So how i do that?

  • I'm using the User media plugin that explains here:

    https://www.scirra.com/manual/144/user-media

    I achieved to record the video but without audio. C2 supports audio record from canvas ?

    Or there is any other plugin that can record video+audio from canvas?

  • I see, Thanks!

  • This code actually works and do what i want, simply to know if there is another way to do it more simple.

    I have an Slider, and for each value i assign to enable a FX on a sprite but i want the other gets disable when the value is not their one.

    So the solution is when other is selected create a function that is called at the starts disabling all efects, and then enable the selected one.

    Any other way to solve it or the actual aproach is ok? There are lots of Blend FX, live about 20, so before do all i want to be sure this is the correct way in case is wrong and i have to build again all the FX system.

  • Is based in the ASCII FX by Gigatron , just i'm editing some variables and the Binary matrix chars to get as i want but there is somethng i can't achieve.

    I think i know where is the problem but after some edits still can't get fixed.

    Original code:

    gl_FragColor = vec4(cha*col,1.);[/code:2u8pxu1u]
    [img="https://cdn.pbrd.co/images/GU4f61p.png"]
    
    But for each character shows a color+black, and i want to get  Light color+Dark color, something like this:
    [code:2u8pxu1u]/gl_FragColor = vec4((cha+col)*col,1.);[/code:2u8pxu1u]
    [img="https://cdn.pbrd.co/images/GU4g4yV.png"]
    
    Now each character have two colors without black, but seems also changes the real black color of the entire image to light colors :S.
    
    How can i fix it?
    
    Here is the actual Shader code i'm using:
    
    [code:2u8pxu1u]// Directlyfrom shadertoy ..By FMS_CAT
    // Adapted by gigatron // have fun !
    
    // AnsiArt version by Matriax 
    
    precision highp float;
    
    uniform float textureSizeWidth; //width of the texture
    uniform float textureSizeHeight; //height of the texture
    uniform float texelSizeX; //width of one texel 
    uniform float texelSizeY; //height of one texel 
    uniform mediump float seconds;
    uniform mediump float pixelWidth;
    uniform mediump float pixelHeight;
    varying mediump vec2 vTex;
    uniform sampler2D samplerFront;
    vec2 iResolution = vec2( 1.0/pixelWidth, 1.0/pixelHeight);
    
    uniform float zoom;
    
    #define P(id,a,b,c,d,e,f,g,h) if( id == int(pos.y) ){ int pa = a+2*(b+2*(c+2*(d+2*(e+2*(f+2*(g+2*(h))))))); cha = floor(mod(float(pa)/pow(2.,float(pos.x)+0.0),2.0)); }
    
    float gray(vec3 _i)
    {
        return (_i.x+_i.y+_i.z)/3.;
    }
    
    void main()
    {
        vec2 uv = -vec2(floor(gl_FragCoord.x/8./zoom)*8.*zoom,floor(gl_FragCoord.y/12./zoom)*12.*zoom)/iResolution;
        ivec2 pos = ivec2(mod(gl_FragCoord.x/zoom,8.),mod(gl_FragCoord.y/zoom,12.));
        vec4 tex = texture2D(samplerFront,vTex);
        float cha = 0.;
        
        {
            float g = gray(tex.xyz);
            if( g < .05 )
            {
              P(11,0,0,0,0,0,0,0,0);
              P(10,0,0,0,0,0,0,0,0);
                P(9,0,0,0,0,0,0,0,0);
                P(8,0,0,0,0,0,0,0,0);
                P(7,0,0,0,0,0,0,0,0);
                P(6,0,0,0,0,0,0,0,0);
                P(5,0,0,0,0,0,0,0,0);
                P(4,0,0,0,0,0,0,0,0);
                P(3,0,0,0,0,0,0,0,0);
                P(2,0,0,0,0,0,0,0,0);
                P(1,0,0,0,0,0,0,0,0);
                P(0,0,0,0,0,0,0,0,0);
            }
            else if( g < .25 ) // .
            {
                
              P(11,0,0,1,0,0,0,1,0);
              P(10,1,0,0,0,1,0,0,0);
                P(9,0,0,1,0,0,0,1,0);
                P(8,1,0,0,0,1,0,0,0);
                P(7,0,0,1,0,0,0,1,0);
                P(6,1,0,0,0,1,0,0,0);
                P(5,0,0,1,0,0,0,1,0);
                P(4,1,0,0,0,1,0,0,0);
                P(3,0,0,1,0,0,0,1,0);
                P(2,1,0,0,0,1,0,0,0);
                P(1,0,0,1,0,0,0,1,0);
                P(0,1,0,0,0,1,0,0,0);
                
                
            }
            else if( g < .5 ) // ,
            {
            	/*
              P(11,1,0,1,0,1,0,1,0);
              P(10,0,1,0,1,0,1,0,1);
                P(9,1,0,1,0,1,0,1,0);
                P(8,0,1,0,1,0,1,0,1);
                P(7,1,0,1,0,1,0,1,0);
                P(6,0,1,0,1,0,1,0,1);
                P(5,1,0,1,0,1,0,1,0);
                P(4,0,1,0,1,0,1,0,1);
                P(3,1,0,1,0,1,0,1,0);
                P(2,0,1,0,1,0,1,0,1);
                P(1,1,0,1,0,1,0,1,0);
                P(0,0,1,0,1,0,1,0,1);
                */
              P(11,0,1,0,1,0,1,0,1);
              P(10,1,0,1,0,1,0,1,0);
                P(9,0,1,0,1,0,1,0,1);
                P(8,1,0,1,0,1,0,1,0);
                P(7,0,1,0,1,0,1,0,1);
                P(6,1,0,1,0,1,0,1,0);
                P(5,0,1,0,1,0,1,0,1);
                P(4,1,0,1,0,1,0,1,0);
                P(3,0,1,0,1,0,1,0,1);
                P(2,1,0,1,0,1,0,1,0);
                P(1,0,1,0,1,0,1,0,1);
                P(0,1,0,1,0,1,0,1,0);
                
                
                
            }
            else if( g < .75 ) // -
            {
              P(11,1,1,0,1,1,1,0,1);
              P(10,0,1,1,1,0,1,1,1);
                P(9,1,1,0,1,1,1,0,1);
                P(8,0,1,1,1,0,1,1,1);
                P(7,1,1,0,1,1,1,0,1);
                P(6,0,1,1,1,0,1,1,1);
                P(5,1,1,0,1,1,1,0,1);
                P(4,0,1,1,1,0,1,1,1);
                P(3,1,1,0,1,1,1,0,1);
                P(2,0,1,1,1,0,1,1,1);
                P(1,1,1,0,1,1,1,0,1);
                P(0,0,1,1,1,0,1,1,1);
            }
     
             else // 100
            {
              P(11,1,1,1,1,1,1,1,1);
              P(10,1,1,1,1,1,1,1,1);
                P(9,1,1,1,1,1,1,1,1);
                P(8,1,1,1,1,1,1,1,1);
                P(7,1,1,1,1,1,1,1,1);
                P(6,1,1,1,1,1,1,1,1);
                P(5,1,1,1,1,1,1,1,1);
                P(4,1,1,1,1,1,1,1,1);
                P(3,1,1,1,1,1,1,1,1);
                P(2,1,1,1,1,1,1,1,1);
                P(1,1,1,1,1,1,1,1,1);
                P(0,1,1,1,1,1,1,1,1);
            }
    	}
        
        //vec3 col = vec3(1.);
        vec3 col = tex.xyz/max(tex.x,max(tex.y,tex.z));
       // gl_FragColor = vec4(cha*col,1.);
        gl_FragColor = vec4((cha+col)*col,1.);
    
    }[/code:2u8pxu1u]
matriax's avatar

matriax

Member since 22 Jun, 2015

Twitter
matriax has 114 followers

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Viral Game One of your games has over 100,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies