jatin1726's Recent Forum Activity

  • Do you mean color name like "blue" or "yellow"? There is no such expression. You will need to write a bunch of events, something like this:

    > Compare variable R>200
    Compare variable G<50
    Compare variable B<50
    			 -> Set colorName="Red"
    
    else
    .....
    

    Something similar sort but comparing variable and then naming is tedious job bcz there are millions of combination and color names possible with 3 RGB values. iS there any way to find out the name by comparing to some database or text file? Also, I noticed that color detected on tap is completely wrong on mobile device but little bit accurate on desktop. Is there any way to increase accuracy of the color detected on tap? And I still want to thank you a lot for showing this possible solution. I was in big need of that.

  • You didn't replace the Canvas object in the project and you didn't do any of the things I suggested!

    1. Remove Rex's Canvas from the project, better uninstall it completely.

    2. Add R0j0hound's Canvas object to the project, set its size 1x1px

    3.

    > Touch On Tap Sprite
    	: Canvas set position to touch.x, touch.y
    	: Canvas paste object Sprite
    	: Text set text to "Red: " & Canvas.redAt(0,0) & " Green: " & Canvas.greenAt(0,0) & " Blue: " & Canvas.blueAt(0,0) 
    

    Thank you dop, it worked flawless and i am able get rgb of the tapped pixel now. Is there any way that i should color name also from the rgb? is it even possible to get color name ?

  • You installed the wrong plugin. You need Canvas by R0j0hound:

    https://www.construct.net/en/forum/extending-construct-2/addons-29/plugin-canvas-41782

    I updated plugin but same thing. This is new capx

    vserv-images.s3.amazonaws.com/adsunit/capx/testcolorcopy2.capx

  • You can retrieve the Color property of an object with the ColorValue expression.

    Hi Ashley, can u please explain how to use that color value expression? I am also in desperate need of the same.

  • Set Canvas size to 1x1 pixel, on click/tap position canvas to that point. Then use "Canvas paste object" or "Canvas paste layer", depending on your needs.

    After that you will be able to get rgb values from Canvas expressions: Canvas.redAt(0,0), Canvas.greenAt(0,0), Canvas.blueAt(0,0)

    I tried something but dont know thats the result. here is my trial capx. Plz help

    vserv-images.s3.amazonaws.com/adsunit/capx/testcolorcopy.capx

  • You need Canvas plugin - put a small Canvas object under the mouse cursor, paste all layers onto it, then you will be able to read pixel color from the canvas. You can probably do this easier with Javascript, but I can't help you with this.

    https://www.construct.net/en/forum/extending-construct-2/addons-29/plugin-canvas-41782

    Hi Dop, thanks for quick reply, can you please share an example in which I can understand that how to extract color of the pixel(using canvas plugin) touched/tapped, then it will be big help for me. Also I have another curosity, can we do the same using webcam picture and tap on the cheek to find out color of skin? canvas plugin could do that?

    Regards,

    Jatin

  • Hi Friends,

    Need urgent help. Is it possible to find out color of touched/tap area of finger touch?

    Thanks in advance.

    Regards,

    Mohan

  • How did you calculate the lX and lY camera position on the mode7 plane?

    I have rewitten the shader and the perspective behavior, to allow changing camera height and scalings in realtime. Not hard at all.

    But im struggling to get the camera to an absolute position over the ground.

    Hi, can u plz tell me how u did that camera scaling thing, a tutorial will be so helpful.

  • These id1,id2,etc.. are actually IIDs. If you only have 2 instances of the object on your layout, their IIDs will be 0 and 1. So you can use:

    distance(Sprite(0).x, Sprite(0).y, Sprite(1).x, Sprite(1).y)

    .

    If you have many instances and need to know the distance between any two, you'll need to find their IIDs first.

    Alternatively, you can create a family with this sprite and do this:

    > Pick Sprite instance
    Pick Family instance
    if distance(Sprite.x, Sprite.y, Family.x, Family.y) ....
    

    Thanks DOP, this way worked for me. Now I can calculate distance between two points now.

  • distance(sprite(id1).x,sprite(id1).y,sprite(id2).x,sprite(id2).y)

    How you assigning id1 etc to your sprites?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • distance(sprite(id1).x,sprite(id1).y,sprite(id2).x,sprite(id2).y)

    Hi Friend,

    I tried above solution but it not taking the function.

    My code is below.

    distance(Dot.IID(63).X,Dot.IID(63).Y,Dot.IID(67).X,Dot.IID(67).Y)

    DOT is my sprite name and for ID im taking IID.

    Regards,

    Jatin

  • Hi Friends,

    Need a help. In my game, objects a and b (of same type) are created.

    How can I find distance between the two objects each time so that when they are closer than 50 px they will blast. (I am using object.IID instead of object.UID)

    Regards,

    Jatin

jatin1726's avatar

jatin1726

Member since 27 Oct, 2014

Twitter
jatin1726 has 4 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • x2
    Popular Game One of your games has over 1,000 players
  • x25
    Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies