Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sample of module
local navGene = {}
local storyboard = require ("storyboard")
local widget = require ("widget")
local dataBase = require ("dataBase")
local ui_news, ui_now, ui_yellow, ui_news_over, ui_now_over, ui_yellow_over
navGene.createNavGene = function()
local path = "ui_footer/"
local imgNews = "news_out.png"
local imgNow = "now_out.png"
local imgYellow = "yellow_out.png"
local imgNews_over = "news_over.png"
local imgNow_over = "now_over.png"
local imgYellow_over = "yellow_over.png"
-- NEWS en 1er rang
ui_news_over = display.newImageRect(path..imgNews_over,109,47,true);
ui_news_over:setReferencePoint ( display.TopLeftReferencePoint );
ui_news_over.x = 0
hauteur = display.viewableContentHeight + ui_news_over.height
ui_news_over.y = hauteur;
ui_news_over.name = "news"
ui_news_over.statut = false
ui_news = display.newImageRect(path..imgNews,109,47,true);
ui_news:setReferencePoint ( display.TopLeftReferencePoint );
ui_news.x = 0
hauteur = display.viewableContentHeight + ui_news.height
ui_news.y = hauteur
ui_news.name = "news"
ui_news.statut = false
-- NOW > passe en 2eme rang
ui_now = display.newImageRect(path..imgNow,100,47,true);
ui_now:setReferencePoint ( display.TopLeftReferencePoint );
ui_now.x = ui_news.width
hauteur = display.viewableContentHeight + ui_now.height
ui_now.y = hauteur;
ui_now.name = "now"
ui_now.statut = false
ui_now_over = display.newImageRect(path..imgNow_over,100,47,true);
ui_now_over:setReferencePoint ( display.TopLeftReferencePoint );
ui_now_over.x = ui_news.width
hauteur = display.viewableContentHeight + ui_now_over.height
ui_now_over.y = hauteur;
ui_now_over.name = "now"
ui_now_over.statut = false
-- YELLOW > 3eme rang
ui_yellow_over = display.newImageRect(path..imgYellow_over,111,47,true);
ui_yellow_over:setReferencePoint ( display.TopLeftReferencePoint );
ui_yellow_over.x = ui_now_over.width + ui_news_over.width
hauteur = display.viewableContentHeight + ui_yellow_over.height
ui_yellow_over.y = hauteur;
ui_yellow_over.name = "yellow"
ui_yellow_over.statut = false
ui_yellow = display.newImageRect(path..imgYellow,111,47,true);
ui_yellow:setReferencePoint ( display.TopLeftReferencePoint );
ui_yellow.x = ui_now.width + ui_news.width
hauteur = display.viewableContentHeight + ui_yellow.height
ui_yellow.y = hauteur;
ui_yellow.name = "yellow"
ui_yellow.statut = false
return ui_news, ui_now, ui_yellow, ui_news_over, ui_now_over, ui_yellow_over
end
navGene.addEventTo = function(bouton)
local function navControler(event)
navGene.manageDirection(event)
end
bouton:addEventListener("touch", navControler)
end
--- I have cut some code there
-- FIN DU MODULE
return navGene
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.