[UE4]为UStaticMeshComponent添加点击事件
BlockMesh->OnClicked.AddDynamic(this, &APuzzleBlock::BlockClicked); //鼠标点击事件
BlockMesh->OnInputTouchBegin.AddDynamic(this, &APuzzleBlock::OnFingerPressedBlock); //触摸屏点击事件 void APuzzleBlock::BlockClicked(UPrimitiveComponent* ClickedComp)
{
bIsActive = !bIsActive; // flip the value of bIsActive
// (if it was true, it becomes false, or vice versa)
if (bIsActive)
{
BlockMesh->SetMaterial(, OrangeMaterial);
}
else
{
BlockMesh->SetMaterial(, BlueMaterial);
}
// Tell the Grid
if (OwningGrid != NULL)
{
OwningGrid->AddScore();
}
// --TO HERE--
} void APuzzleBlock::OnFingerPressedBlock(ETouchIndex::Type FingerIndex, UPrimitiveComponent* TouchedComponent)
{
BlockClicked(TouchedComponent);
}
[UE4]为UStaticMeshComponent添加点击事件的更多相关文章
- iOS开发小技巧 - label中的文字添加点击事件
Label中的文字添加点击事件 GitHub地址:https://github.com/lyb5834/YBAttributeTextTapAction 以前老师讲过类似的功能,自己懒得回头看了,找了 ...
- 【Swift 2.1】为 UIView 添加点击事件和点击效果
前言 UIView 不像 UIButton 加了点击事件就会有点击效果,体验要差不少,这里分别通过自定义和扩展来实现类似 UIButton 的效果. 声明 欢迎转载,但请保留文章原始出处:) 博客园: ...
- echart字符云之添加点击事件
// 路径配置 require.config({ paths : { echarts : 'jquery/echarts-2.2.7/build/dist' } }); // 使用EChart.js画 ...
- ThinkPHP框架下,给jq动态添加的标签添加点击事件移除标签
jq移除标签主要就是$("#要移除的id").remove();不再赘述,这里要提醒的是jq中动态添加标签后怎样添加点击事件.一般的jq添加点击事件是用这种方法$("#i ...
- 继承UIView的子控件添加点击事件
UITapGestureRecognizer*tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:selfaction:@select ...
- 如何在UILable上添加点击事件?
最近开始学习iOS开发,今天上来写第一个iOS笔记 昨天碰到一个需求,在UILable上添加点击事件,网上找了写资料,有人建议用透明的UIButton覆盖,有人建议写一个集成自UILable的类,扩展 ...
- jquery无法为动态生成的元素添加点击事件的解决方法
遇到 jquery无法为动态生成的元素添加点击事件,谷歌一下,整理一下解决方法如下: (<li>中间的元素是动态生成的), 现在想为<i>添加点击事件, 例子如下: <d ...
- Qt:添加点击事件的Label并显示图片
1.给label添加点击事件 Qt中原本的label是没有点击事件的,如果想添加点击事件的话,可以继承QLabel类并重载鼠标事件(比如mousePressedEvent),然后在鼠标事件中发送一个信 ...
- echarts对每个data[i]的图片添加点击事件
1.综述:以饼图为例,只需要对echarts对象option添加以下几行代码即可 //添加点击事件(单击),还有其他鼠标事件和键盘事件等等 myChart1.on("click", ...
随机推荐
- Redis学习第二课:Redis String类型及操作
Strings类型 String是最简单的类型,一个Key对应一个Value,String类型是二进制安全的,可以包含任何数据,比如jpg图片或序列化的对象. Strings类型的操作: Set:设置 ...
- WebGL编程指南案例解析之平移和旋转的math库实现
这里说的math库实现,指的是,通过一般的加减乘除(角度计算)来更新坐标值. 因为涉及到坐标的变化,所以这里都是基于对顶点着色器的修改 平移: var vShader = ` attribute ve ...
- buy now按钮的添加
样例是 www.dealfreeship.com:在D:\xampp\htdocs\aliexpress\app\design\frontend\default\se101\template\cata ...
- GET_DDL提取建表语句:ddl
创建对象的语句就是了 提取表 set line 200 pages 50000 wrap on long 999999 serveroutput on SQL> select dbms_meta ...
- Texas Instruments matrix-gui-2.0 hacking -- index.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- js窗口拖动 模版
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...
- 判断手机端还是pc端
public static bool CheckIsMobile() { bool flag = false; string agent = SystemWeb.HttpContext.Current ...
- nginx+keepalived实现负载均衡nginx的高可用
准备四台服务器 两台做主备,另外两台做访问 192.168.1.120 master 192.168.1.121 backup 192.168.1.122 nginx 192.168.1.123 ng ...
- 51Nod1526 分配笔名
分析 在trie树上贪心,将所有串加入trie树中,在深度较深的地方匹配会更优. 由于只需要知道最后的总质量,所以直接取每个点的子树中最大的匹配即可 复杂度\(O(\sum len)\) 加串的时候把 ...
- device public set
backgroud: our dvertiser provide on device list of idfa to show ad to target audience,however none ...