How TextField's "h" parameter in layout properties works? I tried different values (big, small, negative), but seems like its competently ignored. Correct me if Im wrong.
Is it posible to inherit meta methods like __tostring() ?
Lets say I have
GlobalID =0
foo = Core.class()function foo:init()
GlobalID +=1
self.id = GlobalID
endfunction foo:__tostring()returnstring.format("Object [%i]", self.id)end
bar = Core.class(foo)function bar:init()endlocal a = foo.new()print(a)-- > give us "Object [1]"local b = bar.new()print(b)-- > give us "table: xxxxxxxx"
But I want to print ID for bar object too.
I have one solution, but I dont like it, maybe ther is more elegant way of doing this?
GlobalID =0
foo = Core.class()function foo:init()
GlobalID +=1
self.id = GlobalID
self:gen()endfunction foo:gen()local t =getmetatable(self)
t.__tostring =function(v)returnstring.format("Object [%i]", v.id)endsetmetatable(self, t)end
bar = Core.class(foo)function bar:init()
self:gen()endlocal a = foo.new()print(a)-- > "Object [1]"local b = bar.new()print(b)-- > "Object [2]"
Comments
I have a hierarchy like: Sprite <- foo <- bar <- abc
I did this:<pre class="CodeBlock">
Likes: oleg
Anyways, any info about 2d args Core.class([base, args]) parameter?
Likes: MoKaLux
I tried different values (big, small, negative), but seems like its competently ignored. Correct me if Im wrong.
Likes: rrraptor
So it shoud not work with TLF_CENTER? And if so, I need to center it by myself?Code:
Edit: turns out that TLF_CENTER is horizontal center, and I shoud use TLF_VCENTER also, silly me
Lets say I have
I have one solution, but I dont like it, maybe ther is more elegant way of doing this?