Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

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

No replies to this topic
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]

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)

local function altT( event )

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

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.