Forum > Lua Binding > How to draw a line with Lua?

How to draw a line with Lua?

By ygw365 Posted 2012-03-16 07:27 Comments 3
ygw365
  • Posts: 1

code:
— filename: test.lua
cocos2d.ccDrawLine(createPoint(10, 10),createPoint(100, 100))

the run screen has no effect。

ccDrawLine is only a method,not return object or class,so in the lua script ,can’t use draw method。

help me!!!

dualface
  • Posts: 61

#1 RE: 2012-03-18 03:50

ccDrawLine only call in CCNode:draw()

ex
  • Posts: 26

#2 RE: 2012-05-06 14:01

It seems to me that ccDrawLine is not exported for Lua, I’m missing something?

ex
  • Posts: 26

#3 RE: 2012-05-06 16:56

I found a way to add primitive rendering functions to CCRenderTexture, I’ll uploaded later on my Killa branch, however I only need points and lines but you’ll could extend the method if interested.

Loggin to reply

Copyright © 2010 - 2013 Cocos2d-x.orgClustrmaps