Yeah, there is that. The stuff I've been working on lately already factors scale in to keep lines the same width when you zoom in or out, and no text is rendered until all the transformations are popped off, so I haven't been affected by that so far. I think there's going to be some give and take no matter how you slice it, but so far I'd rather work with the scale transformation than work with weird nths-of-a-meter units.pgimeno wrote:I don't like lg.scale as a substitute in this case, because it scales everything else. Line thickness, fonts, images... Not just the coordinates.
"Questions that don't deserve their own thread" thread
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: "Questions that don't deserve their own thread" thread
- scissors61
- Citizen
- Posts: 76
- Joined: Fri Jan 08, 2016 10:16 am
Re: "Questions that don't deserve their own thread" thread
Hey guys, I'm creating a game that will have a search function and the results will be a long list of items, so I need to create a vertical scrolling list to navigate through every item on the list. My first solution was to draw them all and to "fly" on top of them with gamera. Is this alright or should I just move the Y of every item of the list (notice that the list will have more than 1000 items)?
Re: "Questions that don't deserve their own thread" thread
You can render them all to a canvas and move it's Y instead.scissors61 wrote:Hey guys, I'm creating a game that will have a search function and the results will be a long list of items, so I need to create a vertical scrolling list to navigate through every item on the list. My first solution was to draw them all and to "fly" on top of them with gamera. Is this alright or should I just move the Y of every item of the list (notice that the list will have more than 1000 items)?
Re: "Questions that don't deserve their own thread" thread
A canvas for such a long list isn't really recommended; either draw them all with gamera or (if Gamera doesn't do that for you) figure out which ones are visible, and only draw those.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: "Questions that don't deserve their own thread" thread
Note that you only need to render all the items to the canvas once, after that you can reuse it without any overhead.
That is, as long as the list of items is somewhat static. (Which in de case of a search function, should be.)
That is, as long as the list of items is somewhat static. (Which in de case of a search function, should be.)
Re: "Questions that don't deserve their own thread" thread
The issue is the canvas height; with 1000 elements you'd need at least 12 thousand pixels vertically; I think that's more than most GPUs texture size limit, and it would be a waste of video memory.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: "Questions that don't deserve their own thread" thread
Such a list is not that different to a map, actually. Maybe you could use STI, which handles tile visibility for you. Or handle the visibility yourself.
Re: "Questions that don't deserve their own thread" thread
I'm about to run into this same issue, as my game needs that same type of search feature. As I'm using the Suit lib for gui, I was thinking about creating ~7 buttons where the search results should appear, then using a slider or something to change the "offset" of the buttons index. I've tried that with a text-only dropdown and it works, but I'm not sure if that would be a good idea for a bigger list, with images and stuff. If it works, I'm gonna post it here.
EDIT: let's suppose the game loads some images from a folder and stores them in a table (using love.graphics.newImage() and some loops). Then at some other point of the game, that table is replaced by another table with other images (like imgTable = functionThatReturnsANewTable() ). My question is: are the old images deleted from memory? Is it enough to have no variable storing an image to prevent it from using memory?
EDIT: let's suppose the game loads some images from a folder and stores them in a table (using love.graphics.newImage() and some loops). Then at some other point of the game, that table is replaced by another table with other images (like imgTable = functionThatReturnsANewTable() ). My question is: are the old images deleted from memory? Is it enough to have no variable storing an image to prevent it from using memory?
- scissors61
- Citizen
- Posts: 76
- Joined: Fri Jan 08, 2016 10:16 am
Re: "Questions that don't deserve their own thread" thread
I see. Thanks to all... It seems that it wasn't a bad idea to use gamera. The only risk is the quantity of items becoming too big for the graphics to handle them. If the quantity becomes a problem I'll try to apply Nixola's suggestion of drawing only the items that I'm hovering on.
- HugoBDesigner
- Party member
- Posts: 403
- Joined: Mon Feb 24, 2014 6:54 pm
- Location: Above the Pocket Dimension
- Contact:
Re: "Questions that don't deserve their own thread" thread
Well, I did something that could be of use for you. Don't mind me, I always overdo things when it comes to coding (I'm looking at you Simple Path Animation):
EDIT: Use mouse and/or mousewheel, also click and escape
EDIT: Use mouse and/or mousewheel, also click and escape
Who is online
Users browsing this forum: Semrush [Bot] and 4 guests