|
|
(3 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | __TOC__
| + | #REDIRECT [[Message_in_a_Bottle]] |
− | ==About==
| |
− | This is a Message management library for LOVE. This library requires [[MiddleClass]].
| |
− | [[File:MessageInABottle.png]]
| |
− | | |
− | ==Contact==
| |
− | No forum post yet. Go to the [http://bitbucket.org/dannyfritz/message-in-a-bottle/issues?status=new&status=open Issue Tracker] for bugs. Look around for [[User:Technocat |TechnoCat]] if you have any further questions or concerns.
| |
− | | |
− | ==Features==
| |
− | * Button Bottles
| |
− | * Timed Bottles
| |
− | * Ocean, a management object for Bottles
| |
− | * Very (and hopefully easily) Configurable Bottles
| |
− | * Sleek and Stylish Bottle defaults
| |
− | | |
− | ===Missing Features===
| |
− | Not implemented yet, but plan to.
| |
− | * Boolean Bottles
| |
− | * Choice Bottles
| |
− | | |
− | ==Example==
| |
− | <source lang="lua">
| |
− | require 'MessageInABottle.lua'
| |
− | | |
− | function love.load()
| |
− | love.graphics.setBackgroundColor(255,255,255)
| |
− |
| |
− | --Initialize the ocean to manage the bottles.
| |
− | --It is going to act as a Queue. FIFO
| |
− | ocean = Ocean:new()
| |
− |
| |
− | --Create a timed bottle and add it to the ocean
| |
− | ocean:addBottle(TimeBottle:new(nil,"...",nil))
| |
− |
| |
− | local bottle = StayBottle:new(nil,"What is this?")
| |
− | bottle:setX(310)
| |
− | bottle:setVolume(0)
| |
− | ocean:addBottle(bottle)
| |
− | end
| |
− | | |
− | function love.update(dt)
| |
− | ocean:update(dt)
| |
− | end
| |
− | | |
− | function love.draw()
| |
− | background:draw()
| |
− | love.graphics.setColor(0,0,0)
| |
− | love.graphics.print(
| |
− | 'last bottle return was: '..ocean.response..
| |
− | ' at '..(math.floor(ocean.responseTime*10)/10)..
| |
− | 's from '..ocean.responseID,12,12)
| |
− | ocean:draw()
| |
− | end
| |
− | | |
− | function love.keypressed(k,u)
| |
− | if k=="d" then
| |
− | local x = math.floor(math.random(400))
| |
− | local y = math.floor(math.random(150))
| |
− | ocean:addBottle(TimeBottle:new("PRESSED_D","Timed Box!"))
| |
− | elseif k=="escape" then
| |
− | love.event.push("q")
| |
− | end
| |
− | end
| |
− | </source>
| |
− | | |
− | == See Also ==
| |
− | * [[Libraries]]
| |
− | | |
− | {{#set:LOVE Version=0.7.0}}
| |
− | {{#set:Description=A message library for LOVE.}}
| |
− | [[Category:Libraries]] | |