■ Platform
Android
iOS
■ Documentation : https://www.npmjs.com/package/cordova-p ... rientation
Code: Select all
Enumeration
#mf
#mfOrientation
EndEnumeration
Declare Start()
Declare OnResize()
;No debug
CloseDebugOutput()
ExamineDesktops()
;Import Cordova Plugin
Import "cordova plugin add cordova-plugin-orientation"
EndImport
Start()
Procedure Start()
Protected Font = LoadFont(-1, "Arial", 16)
OpenWindow(#mf, 0, 0, 0, 0, "Orientation", #PB_Window_Background)
TextGadget(#mfOrientation, 20, 20, 400, 24, "")
SetGadgetFont(#mfOrientation, FontID(Font))
OnResize()
BindEvent(#PB_Event_SizeDesktop, @OnResize())
EndProcedure
Procedure OnResize()
Protected Orientation.s
Protected Width = DesktopWidth(0)
Protected Height = DesktopHeight(0)
!v_orientation = screen.orientation.type
SetGadgetText(#mfOrientation, Orientation)
ResizeWindow(#mf, 0, 0, Width, Height)
EndProcedure