GuiTouchRotate

Constructor:

GuiTouchRotate({ newtouch1.position, newtouch2.position }, signedAngle, signedAnglespeed , touchState)

Description

This event is triggered when two fingers are rotated on the GUI object.

Parameters

Name Type Description
{ newtouch1.position, newtouch2.position } table {TouchPoint1 position, TouchPoint2 position}
signedAngle float Rotation angle per frame
signedAnglespeed float Rotation velocity
touchState Enum.UserInputState Input type state

Examples

Add the following client script under ClientfirstLogic. Start the game, and rotate fingers on the mobile phone. Observe whether the event is triggered or not.

wait(1)
local uipanel = RWObject.Create("UiPanel") -- create a UiPanel
local uibtn = RWObject.Create("UiButton") -- create a UiButton
uibtn.Parent = uipanel -- set the parent of the created UiButton to the new created UiPanel
local person = Players:GetLocalPlayer() -- retrieve the player
uipanel.Parent = person. GameUI -- Set the parent of the UiPanel as GameUI
uibtn.TouchRotate:Connect(function(obj,dir,speed,state) -- register the event that is triggered when rotating fingers on the GUI object for the UiButton
      uibtn.ImageColor = Vector3.New(255,0,0) -- the button turns red
    print("The event of rotating fingers on the GUI object is triggered")
    print(tostring(dir))
    print(tostring(speed))
    print(tostring(state))
end)