Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Update altitude?
Started by Marco De Vincenzi Mar 12 2015 08:53 AM

No replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Marco De Vincenzi

[GLOBAL: userInfoPane.html]
Marco De Vincenzi
  • Contributor

  • 111 posts
  • Corona SDK

Hi, is it possible to change altitude every time it changes? 

I'm using this code:

local alti = display.newText( "-"   , 260, 485, "HelveticaNeue-UltraLight", 19)
sceneGroup:insert(alti)

local function altT( event )


    local altText = string.format( '%.3f', event.altitude )
        alti.text = altText*1.1

   
end
Runtime:addEventListener( "location", altT )

I'd like the value "alti" to change every time altitude changes. 

(Like happens in an app called "Ski Tracks") were altitude changes constantly.




[topic_controls]
[/topic_controls]