Hello
I'm looking for a tutorial to create a scrolling text
Thank you
I'm looking for a tutorial to create a scrolling text
-
- Prole
- Posts: 7
- Joined: Sun Sep 16, 2018 4:26 pm
Re: I'm looking for a tutorial to create a scrolling text
I am also looking for it because i cannot find any proper and good tutorials on youtube and the ones on udemy are not free and i am broke.
- NotARaptor
- Citizen
- Posts: 59
- Joined: Thu Feb 22, 2018 3:15 pm
Re: I'm looking for a tutorial to create a scrolling text
Hi Bernard51
Why do you need a tutorial?
Do you know how to write text to the screen? It's love.graphics.print. The second and third parameters are the coordinates - modify them and the text moves... scrolling text.
If you're looking for a specific type of scrolling text (Star Wars crawl, etc) then you could find a tutorial, I'm sure.
But what's wrong with just giving it a go? Here I'll get you started:
(Code written directly here, not tested - concept is sound though)
Can you make it scroll the other way? How about vertically? Can you detect when the scrolling has finished (hint: you'll need Font:getWidth)
Can you vary the speed? Vary the size of the text? What about doing it character by character? What about rendering the above to an off-screen buffer and then rendering to the screen with a shader?
Don't look for a tutorial. Start. Code. Play. Enjoy. You can teach yourself far better than a tutorial can.
Why do you need a tutorial?
Do you know how to write text to the screen? It's love.graphics.print. The second and third parameters are the coordinates - modify them and the text moves... scrolling text.
If you're looking for a specific type of scrolling text (Star Wars crawl, etc) then you could find a tutorial, I'm sure.
But what's wrong with just giving it a go? Here I'll get you started:
Code: Select all
local text = "Bacon ipsum dolor amet reprehenderit pig magna anim in ipsum ex consectetur landjaeger chuck chicken lorem. Shank ut short ribs, pariatur shoulder proident filet mignon labore meatloaf. Shoulder dolore culpa cupidatat pork chop tri-tip minim. Duis voluptate aliquip porchetta, corned beef eiusmod in. Excepteur venison turkey swine mollit id. Eu prosciutto excepteur leberkas."
local text_x_pos
local text_y_pos
local text_scroll_speed = 100
function love.load()
text_x_pos = love.graphics.getWidth()
text_y_pos = love.graphics.getHeight() / 2
end
function love.update(dt)
text_x_pos = text_x_pos - text_scroll_speed * dt
end
function love.draw()
love.graphics.print(text, text_x_pos, text_y_pos)
end
Can you make it scroll the other way? How about vertically? Can you detect when the scrolling has finished (hint: you'll need Font:getWidth)
Can you vary the speed? Vary the size of the text? What about doing it character by character? What about rendering the above to an off-screen buffer and then rendering to the screen with a shader?
Don't look for a tutorial. Start. Code. Play. Enjoy. You can teach yourself far better than a tutorial can.
Re: I'm looking for a tutorial to create a scrolling text
how to make the text once of the screen on the left come back by the exit of right?
Who is online
Users browsing this forum: No registered users and 4 guests