Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8217171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:22:29+00:00 2026-06-07T12:22:29+00:00

settings.lua local lang_table = { {image = display.newImage(en.png), x = 600, y = 400,

  • 0

settings.lua

 local lang_table = {
    {image = display.newImage("en.png"), x = 600, y = 400, lang = "1033", i = 1},
    {image = display.newImage("fr.png"), x = 600, y = 400, lang = "fr", i = 2},
    {image = display.newImage("dk.png"), x = 600, y = 400, lang = "dk", i = 3},
    {image = display.newImage("ge.png"), x = 600, y = 400, lang = "ge", i = 4}                                      }

local function changelanguage (event)
  if event.phase == "ended" then
    lang_table[event.target.i].image.isVisible = false
    if event.target.i == 4 then
      lang_table[1].image.isVisible = true
      _G.value = event.target.lang
      director:changeScene("settings")
    else
      lang_table[event.target.i+1].image.isVisible = true
      _G.value = lang_table[event.target.i+1].lang
      director:changeScene("settings")
   end
  end
  return true
end

for i = 1,#lang_table do 
    local img_display = lang_table[i].image
    img_display.x = lang_table[i].x
    img_display.y = lang_table[i].y
    img_display.i = lang_table[i].i
    img_display.lang = lang_table[i].lang

    if _G.value ~= lang_table[i].lang then
        img_display.isVisible = false
    end

    img_display:addEventListener("touch", changelanguage)
    langGroup:insert(img_display)
end

When I touch the image,changelanguage function is being invoked.In that function there is

director:changeScene

but this is not working.Basically,what I want is that whenever there is touch event to the image I want the same lua file to be called.But this is not happening.Then What I did was changed the function “changelanguage” to

_G.t =1
local function changelanguage (event)
    if event.phase == "ended" then
        lang_table[event.target.i].image.isVisible = false
        if event.target.i == 7 then
            lang_table[1].image.isVisible = true
            _G.value = event.target.lang
            director:changeScene("settings")
        else
            lang_table[event.target.i+1].image.isVisible = true
            _G.value = lang_table[event.target.i+1].lang
            if _G.t ==1 then
                director:changeScene("..\settings")
                _G.t = _G.t+1
            elseif _G.t ==2 then
                director:changeScene("..\..\settings")
            end
        end
    end
    return true
end

Now, it is working.But I dont know why is this happening.Can anyone suggest me why is this happening.Cant I use the same director:changeScene("settings") to change the scene again and again on touch event.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:22:30+00:00Added an answer on June 7, 2026 at 12:22 pm

    You cannot use Director to change to a scene you are already in, eg, calling director:changeScene(“settings”) from within settings.lua, no.

    You can do this in Storyboard, however. (It may be worth considering a switch if this is something you will be doing a lot of, alternatively you could make a file such as reset.lua and write functions within there to effectively reload any scene you liked simply by changing to reset and back to the previous scene again.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$('div#Settings ul li').click(function () { var url, template; var self = $(this); if (!$(self).hasClass('selected'))
var settings = {}; $(.js-gen-settings).each(function(){ var date; if (($(this).attr(type) === checkbox) || ($(this).attr(type) ===
$(settings.widgetSelector, $(settings.columns)).each(function () { var thisWidgetSettings = iNettuts.getWidgetSettings(this.id); if (thisWidgetSettings.removable) { $('<a href=# class=remove>CLOSE</a>').mousedown(function
Settings.settings generates Settings.Designer.cs which presumably generates app.config which then is copied to output directory
Settings table contains always one row with lot of long-caption columns. Opening this in
The Settings/Accessibility Large Text setting sets the text size in some built-in Apps. How
jeditable settings $('.editable').editable('includes/notes/save.php', { loadurl : 'includes/notes/load.php?id=' + $(this).find(div).prop(id),//undefined child ID type : 'text',
In settings.py I have setup a way to log my messages like this: logging.basicConfig(
I settings my info.plist as below: Initial interface orientation: Landscape (left home button) Supported
Libspotify stores settings in a file called settings. Now, it seems that it discards

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.