online changelog? --help please

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
CloudyYard
Prole
Posts: 12
Joined: Fri Jul 03, 2015 8:54 pm

online changelog? --help please

Post by CloudyYard »

Hello everyone!,
i need to put a ChangeLog in My game but is possible make the changelog online?
for example:
in the site: http://www.example.com/changelog.txt

and shows the changelog.txt content in the Love2D window!


thanks.
User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Above the Pocket Dimension
Contact:

Re: online changelog? --help please

Post by HugoBDesigner »

If you already have the text online somewhere, then it should be possible by using http.request:

http://w3.impa.br/~diego/software/luasocket/http.html
@HugoBDesigner - Twitter
HugoBDesigner - Blog
CloudyYard
Prole
Posts: 12
Joined: Fri Jul 03, 2015 8:54 pm

Re: online changelog? --help please

Post by CloudyYard »

Thanks, but how to print what have in the File:http://www.cs.princeton.edu/~diego/prof ... /http.html?

i need to make a changelog to my game, to make the Updates and News...
User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Above the Pocket Dimension
Contact:

Re: online changelog? --help please

Post by HugoBDesigner »

I personally think it is easier to learn from examples than from boring explanations (that's how I actually learned programming :rofl: )

So here's a very simple example on how to load/print online content:

Code: Select all

function love.load()
	http = require("socket.http")
	a, b = http.request("http://pastebin.com/raw.php?i=NW3H038r")
	love.graphics.setBackgroundColor(255, 255, 255)
	if a and b then
		a = string.gsub(a, "\r\n", "\n")
	end
end

function love.draw()
	love.graphics.setColor(0, 0, 0, 255)
	if b then
		love.graphics.print("Code: " .. tostring(b), 7, 7)
	end
	if a then
		love.graphics.print("Content:\n\n" .. tostring(a), 7, 7+32)
	end
end
@HugoBDesigner - Twitter
HugoBDesigner - Blog
CloudyYard
Prole
Posts: 12
Joined: Fri Jul 03, 2015 8:54 pm

Re: online changelog? --help please

Post by CloudyYard »

Thanks!!,
thanks too much, now is working,

soon i will publish my game!!.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot] and 4 guests