<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