Heya!
I was wondering... if I add a "point" with "point.x" and "point.y" to another table at places like points[1] and points[2]... how would I access the x and y?
This is obviously something really simple but I feel like I've tried everything. (Well obviously not since it must be possible)
table in table
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: table in table
points[1].x
assuming your tables are structures like
assuming your tables are structures like
Code: Select all
osgeld@osgeld:~$ lua
Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> points = {{x = 0, y = 0}}
> print(points[1].x)
0 -- output of print statement
>
Re: table in table
Thanks, it made me check the index, which I then realized I forgot to set the first one (points[1]).osgeld wrote:points[1].x
assuming your tables are structures like
Code: Select all
osgeld@osgeld:~$ lua Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio > points = {{x = 0, y = 0}} > print(points[1].x) 0 -- output of print statement >
Works now whohoo!
edit: attached the source if anyone was interested in what it was all about
- Attachments
-
- cuberotate.love
- (1.04 KiB) Downloaded 98 times
srejv
Re: table in table
That's pretty schwey. Now add textures, champ.
We don't borrow, we don't read, we don't rent, we don't lease, we take the minds!
Re: table in table
Haha, made a filled cube. Gonna try textures once I get my head around backface culling :]
srejv
Who is online
Users browsing this forum: Bing [Bot] and 55 guests