How to make drawn texture?

dear cocos developer.
i’m using creator ver 1.9.2.
i’m making pixel art game from cocos creator to web play game(facebook instantgame)
but, i don’t know how to make drawn texture (font or sprite such as another pixel art program’s background).
how to draw font or attach sprite dynamicaly in background?
it didn’t use puzzle png file. just want to use puzzle’s data file (json file) and font file.
please guide me :frowning:

anyone can help me?

You can add components dynamically & also add sprites and change their color.
http://www.cocos2d-x.org/docs/creator/api/en/classes/Node.html#addcomponent

thank askamn.
but it is not i wanted.
i think, addcomponent or instantiate each font is high cost in gameScene.
what i want to know is similar to Unity’s “Graphics.DrawTexture” function

I dont think that’s possible. Because as far as I remember, there is no way in cocos creator (js) to init a texture with binary data. There is a function, but that is not available yet… (not sure, but I tried, it didn’t work :P)

You can try using cc.Graphics. It can be used for trying. Attach aa Graphics Component to a node and access it inside the script to draw things. You can then manually add a Label component to draw fonts.

Although, have a look at this: http://docs.cocos.com/creator/api/en/classes/Texture2D.html#initwithdata
It is supposed to work just like you want. But I could never get it to work, haha