Best way to display a table / graph

Get help using Construct 2

Post » Mon Jun 08, 2015 6:12 pm

This isn't really C2's cup of tea, so I'm wondering, what's the best way?

I need a league table (sports table), showing 16 teams and 12 columns for each team. This is always set, so that makes it a bit easier. I want to be able to resize the table depending on the size of my screen.

My initial thought is to just draw the table in a paint package and then stretch it to the correct size. I could put image points in for the various boxes to allow me to place the text. Not sure if this is ideal, but I know how to do it. The only downside I can think of is that the initial graphic will be large and take up a lot of memory.

Another thought is to draw a single row graphic in a paint package, and then just stack 16 of them ontop of each other, placing the text inside the graphic.

Any of methods? Draw lines individually maybe?
B
26
S
6
G
4
Posts: 456
Reputation: 5,853

Post » Mon Jun 08, 2015 6:17 pm

That's about 200 things on your horizontal axis which would seem to be tough to distinguish. If you want columns, the simplest way would be to create a single sprite and colour it using web effects, or to create one bar for each colour, and just scale it and clone it as you need.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Mon Jun 08, 2015 6:31 pm

I would opt for the 9-patch object and reuse it as often as needed..
or
create the lines (and background) with the tiled background object (which would only take two sprites of 8x8px)..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jun 08, 2015 8:34 pm

paulscottrobson wrote:That's about 200 things on your horizontal axis which would seem to be tough to distinguish. If you want columns, the simplest way would be to create a single sprite and colour it using web effects, or to create one bar for each colour, and just scale it and clone it as you need.


I didn't describe it properly. It would be 16 rows and 12 columns. Not 16 * 12 on each row.

LittleStain wrote:I would opt for the 9-patch object and reuse it as often as needed..
or
create the lines (and background) with the tiled background object (which would only take two sprites of 8x8px)..


I was thinking about loads of 9-patches, basically one for each cell, which would solve it, including colouring each cell differently where necessary. But it's 192 cells which seems a bit many? Still, I do like this idea most so far. But what do you mean about the tiled background object using 2 sprites of 8x8? That sounds promising too, but I'm not sure how that'd work.
B
26
S
6
G
4
Posts: 456
Reputation: 5,853

Post » Mon Jun 08, 2015 9:39 pm

Not sure if it would work for your idea, but..
I meant like this:

https://dl.dropboxusercontent.com/u/485 ... Table.capx

only three tiled backgrounds of 8x8..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jun 08, 2015 11:58 pm

Oh I see. That's pretty good, I hadn't thought of that and yes, it would work for my game. I'm not sure which would be fastest / most efficient. Since my game is turn-based and the screens are mostly static, it might not matter too much but the tiled backgrounds do seem to be using a lot less objects at least. I'd be looking at 200 objects (9patches) v about 40 or so.
B
26
S
6
G
4
Posts: 456
Reputation: 5,853


Return to How do I....?

Who is online

Users browsing this forum: worm1 and 19 guests