Hi guys,
I'm having an issue whereby I want to conditionally change the color of some of the text in my ui, which is made up of TextObjects in a table, and drawn using a for loop. I'm not sure what's going wrong, but I suspect that either:
- love is only drawing the for loop once, not updating it regularly, so the changes to the TextObject variable aren't being drawn
- hump.timer is messing around with my conditional statement (though i implemented another way to change the color using a keypress rather than a conditional statement, so I don't think it's that)
- unknown
Any advice you have would be appreciated please find attached below the code I am using (apologies that it's zipped, it's the only away my internet would let me upload it). To find the bug, move the player using the arrow keys up onto the red "U" and press either "d" or "i". Either 'should' result in colors being changed somewhere.
Thanks in advance
draw(TextObject) won't update color of TextObject?
draw(TextObject) won't update color of TextObject?
- Attachments
-
- deep.space.zip
- (409.08 KiB) Downloaded 128 times
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: draw(TextObject) won't update color of TextObject?
EDIT: Wrong thread! as zorg pointed out, sorry.
Also you should post a love file instead of a .zip so here you go Now, I don't really get what the problem is, what should change color? how? when? I still haven't checked the code, but I got a ship and I could move around...
Also you should post a love file instead of a .zip so here you go Now, I don't really get what the problem is, what should change color? how? when? I still haven't checked the code, but I got a ship and I could move around...
Last edited by Positive07 on Tue Feb 14, 2017 8:59 am, edited 1 time in total.
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: draw(TextObject) won't update color of TextObject?
Positive07: Wrong thread, i reposted your answer over to the right one.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: draw(TextObject) won't update color of TextObject?
Hi Positive07,
Basically, if you move the character onto the "U" and press d, on the right where it lists the systems, it should print the system status underneath each line in either red or green based on whether the status is online or offline. My issue is that love.draw() doesn't seem to be updating when i change the TextObject parameters in the right.lines table.
The code responsible is in ui.lua, around line 140.
Let me know if i can clarify any further
Basically, if you move the character onto the "U" and press d, on the right where it lists the systems, it should print the system status underneath each line in either red or green based on whether the status is online or offline. My issue is that love.draw() doesn't seem to be updating when i change the TextObject parameters in the right.lines table.
The code responsible is in ui.lua, around line 140.
Let me know if i can clarify any further
Re: draw(TextObject) won't update color of TextObject?
Mitchist, I tried to do some debugging in Zerobrane. The values looked ok so I tried to experiment a bit.
Getting rid of the wait thingy produced the following. So it's wait borking things up, plus it's drawing in the wrong place.
Getting rid of the wait thingy produced the following. So it's wait borking things up, plus it's drawing in the wrong place.
Who is online
Users browsing this forum: No registered users and 1 guest