Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, I'm trying to do a 2D game where an object is clickable (click on it for something to happen) and the transparent area in the area is still clickable? (it's a png-file). The png-picture is attached to an 2D Overlay which has the behavior that something should happen when I click on it. Is there anyway to work around this? |
||||
|
Don't use CC for a 2D game, lazlo. 2D games don't need engines. If you must use an engine, then use GDevelop or GB Studio. ![]() |
||||
|
There is no way to detect click based on alpha using engine's built-in functionality. You can though workaround by defining a polygon shape that more or less corresponds to your picture, and then detecting if mouse cursor is currently inside that shape. This requires coding obviously. The idea is to get something likehttps://www.youtube.com/watch?v=.... You can get mouse position using corresponding function from ccb api refs sheet. Another way would be to use 3d meshes instead of 3d, which might work or not for you based on your scene setup. @guest_Guest You're not answering the question OP asked. Why post if you don't know the answer. 2D games don't need engines. Your today's comments are pure gold. |
||||
|
Use a framework, not an engine... doofus. |
||||
|
Pygame, Love2D, Raylib... you comprende now? I did answer OP's question... Don't make 2D games in CC. Duh. |
||||
|
- is there a way to work around my issue? - don't use coppercube Perfect answer, as always. Whoa, you also speak Spanish besides Portuguese, lol. So why not use an engine that has 2d support, or primary target 2d: godot, unity, defold? Why these even exist if they are useless? Why do you even mention those frameworks, if you can't code anyway? I saw an extension you made for VP. The one there you copied one line 150 times instead of utilizing a loop. You could even add a loop break or return statement, in case condition is not specified by the end user, which is a huge optimization. I've wrote a lot of crappy code, but I would be ashamed to publish something like that. |
||||
|
Also stop using my nickname. |
||||
|
Or what? :) This is someone else this time - not whoever used it last time. We all know it's you, Zoo, you complete failure. I was hoping what happened would've scared you away from ever coming back here, but I guess that wasn't enough. Maybe have to do other stuff to really put you in your place... |
||||
|
Lol, it's me okeoke. This is my new account here from now. So, taking about failures, how's your mario/jam game? Have you produced something besides salt and suggestions to use another engines recently? |
||||
|
Oh boy, haha, no, wasn't referring to you, okeoke, promise. I was referring to the other guest. The one who loves to keep calling JIC derogatory names (and has a real vendetta against him - there's only one member of this community who has a real hatred for him, and you know who he is, surely). Oh, speaking of which, you'd asked me to add you on discord again. I sent a request to okeoke and it was someone else. For a bit of a refresher / hint as to who this is, without saying a precise name... I was a bit of an S2Engine fanatic :) was downright obsessed with version 1.4.5 and was dead-set on making something with that crusty old version, and didn't quite get anywhere. |
||||
|
Oh wow, I remember a guy who fits this description:) Please add me again, it's okeoke1234. I tried to add your old account multiple times, but it seems like it's either deleted or friends requests are restricted. |
|