Can you use an emoji (or emoji text code) as an object in Kaboom

Hi,

Instead of using a sprite, can you use an emoji or emoji character instead of a sprite?
For example, a thumbs-up emoji code is: “:+1:

If so, how would I do that ? It doesn’t work with text.

const enemy = add([
  pos(100, 28),
  text("🐥")
]);

Welcome to the community! Maybe just get the image for the emoji and then use that as the sprite? On Ask emoji’s are converted to images automatically so you could just right click and Save image as the thumbs up in your post and then add that to your Kaboom project

2 Likes

Hi Matt,
I really do not want to use a sprite, I want to be able to create using only text/emoji codes and rect/circles.
Anyway to view emojis within the kaboom, without loading a sprite?

1 Like

You could try copying the emoji character directly into the string rather than using the HTML entity (text likely renders like actual text rather than HTML). Otherwise I’m not sure, sorry, I don’t really use Kaboom, I’m the kind of person that’d make my own game engine. Hopefully someone else will be able to help you :slight_smile:

did some research, and the reason why is because Kaboom is using a bitmap font, and it only supports the basic ascii characters. You would have to use the loadFont() function with a custom font in order to use other characters

2 Likes