<kbd id="9plqc"><label id="9plqc"></label></kbd>

        <th id="9plqc"></th>
        1. <center id="9plqc"><video id="9plqc"></video></center>
          <sub id="9plqc"><form id="9plqc"><pre id="9plqc"></pre></form></sub>
          <nav id="9plqc"><form id="9plqc"><legend id="9plqc"></legend></form></nav>
          UE4 安卓觸摸事件相關問題 您所在的位置:網(wǎng)站首頁 屬羊有幾個孩子女男孩 UE4 安卓觸摸事件相關問題

          UE4 安卓觸摸事件相關問題

          2024-12-04 03:36| 來源: 網(wǎng)絡整理| 查看: 265

          UE4在安卓端獲取輸入信息時候,似乎會把觸摸事件和PC端的鼠標事件弄混在一起,導致出現(xiàn)一些奇怪的問題。

          1. /* 安卓端會把觸摸事件讀取成PC端的鼠標事件,因為Turn和LookUp在PC端開發(fā)時候一般都綁定在鼠標X軸,Y軸上,

          * 所以這里要對安卓端做一些特殊處理。

          */

          #if !PLATFORM_ANDROID ? PlayerInputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput); ? PlayerInputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput); #endif

          ?

          2. 在列表中放置按鈕時候因為需要把按鈕的 ClickMethod設置為 PreciseClick,這樣才能在左鍵拖動鼠標時候滑動列表。對應的在移動端設備中則應該修改TouchMethod為 PreciseTap,這樣才能滑動列表,但是同理因為安卓端的問題,該處地方 ClickMethod 不能為PreciseClick,改為 DownAndUp就好。

          如若不然,可能會導致個別奇怪問題,比如某個地方的按鈕不能接收到ClickEvent。

          ?

          3.在PlayerController的InputTouch函數(shù)中獲取到的TouchLocation時,TouchBegin和TouchMove消息獲取的位置比TouchEnd的位置大1.5倍。而且通過PlayerInputComponent綁定的TouchEnd消息不能觸發(fā)。

          ?

          bool AMyPlayerController::InputTouch(uint32 Handle, ETouchType::Type Type, const FVector2D& TouchLocation, float Force, FDateTime DeviceTimestamp, uint32 TouchpadIndex) { #if PLATFORM_ANDROID FVector2D EndTouchLocation = TouchLocation; //end消息在android下存在問題,需要乘以1.5倍 if (Type == ETouchType::Ended) { EndTouchLocation *= 1.5f; } #endif ... }//本文為CSDN博主執(zhí)手畫眉彎原創(chuàng),未經(jīng)允許不得轉(zhuǎn)載! bool AMyCharacter::EnableTouchscreenMovement(class UInputComponent* PlayerInputComponent) { if (FPlatformMisc::SupportsTouchInput() || GetDefault()->bUseMouseForTouch) { PlayerInputComponent->BindTouch(EInputEvent::IE_Pressed, this, &AMyCharacter::BeginTouch); #if !PLATFORM_ANDROID //安卓設備接收不到結(jié)束點擊事件 PlayerInputComponent->BindTouch(EInputEvent::IE_Released, this, &AMyCharacter::EndTouch); #endif //Commenting this out to be more consistent with FPS BP template. PlayerInputComponent->BindTouch(EInputEvent::IE_Repeat, this, &AMyCharacter::TouchUpdate); return true; } return false; }//本文為CSDN博主執(zhí)手畫眉彎原創(chuàng),未經(jīng)允許不得轉(zhuǎn)載!

          注:EnableTouchscreenMovement函數(shù)在重載的SetupPlayerInputComponent函數(shù)中調(diào)用。

          ?



          【本文地址】

          公司簡介

          聯(lián)系我們

          今日新聞

          推薦新聞

          專題文章
            CopyRight 2018-2019 實驗室設備網(wǎng) 版權(quán)所有
            黄色免费网站在线看,韩国精品在线观看,韩国美女一区二区,99国产热 仲巴县| 天峨县| 大悟县| 固始县| 祁门县| 屯昌县| 繁昌县| 天柱县| 江阴市| 宾阳县| 阜新| 铜山县| 丹棱县| 鲁甸县| 东丽区| 龙游县| 龙山县| 文山县| 余干县| 寿宁县| 怀宁县| 合作市| 西吉县| 甘洛县| 朔州市| 枝江市| 留坝县| 治多县| 客服| 扬州市| 许昌县| 璧山县| 西和县| 马边| 顺平县| 嘉兴市| 社会| 文山县| 尉氏县| 颍上县| 托里县| http://444 http://444 http://444 http://444 http://444 http://444