text madness
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
text madness
so i was working on an rpg prototype and decided hey, lets interact with this object! so the basic idea is that I want the object (the square at the end of the thing) to display some text which i got working. the problem is when I want to change that text. I did a circular query around the player and it doesnt seem to do anything. I want the player to lose all control of the player and then diffrent text to appear, and then regain control, and if you walk away then the text should go away. please help as i find making text very difficult in love2d
- Attachments
-
- main.love
- (49.94 KiB) Downloaded 65 times
Re: text madness
It's a bit unclear what you want. What text should be displayed? I'm assuming we're talking about the code in interactable.lua. Do you want each 'interactable' object to display different a text? You could add a text field to 'self' in interactable:load() and draw the text with love.graphics.print(self.text) in interactable:draw().
The interactable's text could also be an argument for the interactable:load() function.
Code: Select all
function interactable:load()
self.text = "foobar" -- You can use different texts for different interactables.
-- ...
end
function interactable:draw()
-- ...
love.graphics.print(self.text)
-- ...
end
Code: Select all
function interactable:load(text)
self.text = text
-- ...
end
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Re: text madness
Something like this?
If you reach that object, you can not move, and the keypresses are used to display next message. When all messages were displayed, control is gained to player again.
Basically I added texts and textsShown to interactable:load, then handled text draw in interactable:draw and added interactable:keypressed which is called in new love.keypressed which switches texts (see attached code)
If you reach that object, you can not move, and the keypresses are used to display next message. When all messages were displayed, control is gained to player again.
Basically I added texts and textsShown to interactable:load, then handled text draw in interactable:draw and added interactable:keypressed which is called in new love.keypressed which switches texts (see attached code)
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 9 guests