Sample of code that uses JPAnimation
object.setTranslation ( this.hCurrentCar ( ), 0, 5, 0, object.kGlobalSpace )
JPAnimation.enterAnimationMode ( true )
JPAnimation.setDuration ( 1 )
JPAnimation.setAnimation ( "easeOutBounce" )
object.setTranslation ( this.hCurrentCar ( ), 0, 0, 0, object.kGlobalSpace )
JPAnimation.leaveAnimationMode ( this.getObject ( ), "CarSelection", "onCarDidAppear" )
Sample of code that uses JPEditText
local hFastFilter = hud.getComponent ( application.getCurrentUser ( ), "ScreenScores.FastFilter" )
JPEditText.setEditTextPlaceholder ( hFastFilter, "Search for a name...", 80, 80, 80, 255 )
Sample of code that uses JPPicker
function ScreenRace.onLoad ( )
local nItemCount = table.getSize ( this.tRaces ( ) )
local nStartItem = 0
local bScrollOnX = false
local bMustStopOnItems = true
local sID = JPPicker.addPicker ( nil, nItemCount, nStartItem, bScrollOnX, bMustStopOnItems )
this.sRacesPickerID ( sID )
JPPicker.setMouseCoef ( sID, 5 )
end
function ScreenRace.onPickerPositionDidChange ( sID, nPosition, nItemIndex )
if ( sID == this.sRacesPickerID ( ) )
then
this.updateRaceList ( nPosition )
end
end
function ScreenRace.onPickerCenterItemDidChange ( sID, nIndex, bListCurrentlyScrollingToItem )
if ( sID == this.sRacesPickerID ( ) )
then
local sMapSpriteName = table.getAt ( this.tRaces ( ), nIndex )
JPSprite.setComponentSprite ( "ScreenRace.RaceMapImage", sMapSpriteName, false, false, true )
end
end