Re: [luabind] pass by ref, no matching overload found
Brought to you by:
arvidn,
daniel_wallin
|
From: Christian N. <cn...@gm...> - 2015-03-31 21:41:17
|
On 2015-03-31 23:33 +0200, Сергей ВладимировичСергей Владимирович wrote:
> [...]
>
> I want to set tag for node from lua script:
> node = scene:find ( "NewGameButton" )
> node:setTag ( "scale", value )
>
> I get luabind error:
> No matching overload found, candidates:
> void setTag(Node&,std::string const&,std::string const&)
>
> But this line works fine
> node:setTag ( "scale", "str_value" )
>
> How to get setTag working in both cases?
>
It seems that value is not a string. AFAIR luabind does not implicitly
convert numbers to strings, so you should try
node:setTag ( "scale", tostring( value ) )
where tostring() is a Lua standard library function
(http://www.lua.org/manual/5.1/manual.html#pdf-tostring).
|