Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics


Create cool 2D games with a free game editor! · By Cosmo Myzrail Gorynych

"Type clicked" feature request

A topic by enrike created 24 days ago Views: 28 Replies: 3
Viewing posts 1 to 3
hi (I am new to CTJS so sorry if this question sounds weird, Im still trying to understand its logic. It looks great btw) Would it be possible to simplify the "type clicked" event from if (ct.mouse.pressed) { if (ct.u.pointRectangle(ct.mouse.x, ct.mouse.y, this)) { // do whatever } } to something like if (ct.mouse.pressed(this) { // do whatever } thanks enrike

There's already one:

if (ct.mouse.pressed && ct.mouse.hovers(this)) {
    // do whatever

It won't be simplified ever further because hovering over an element and pressing a mouse are two separate actions. You can write your own helpers in scripts to do it, though.

Thanks. That makes sense. I have a couple of other things to metion on the distribution and usability though. Do you prefer them here or in Github's Issues?


GitHub is better, as it is a more track-able space and I check it more often (:

A link to ct.js issues