UDK HUD问题
你好 我正在尝试向 hud 添加新元素 它的配偶是一个指南针,其功能应该像小地图一样
我已将此代码添加到主 hud.swf
var DcompassContainer:MovieClip = this.createEmptyMovieClip("DcompassContainer", this.getNextHighestDepth());
DcompassContainer._x = 280;
DcompassContainer._y = 8;
DcompassContainer.loadMovie("udk_compass.swf");
到目前为止,一切都很好 中主 MC 的信息
这是 Flash名称方向 实例名称 定向 标识符定向 类 com.scaleform.direction
类文件中的
import flash.external.ExternalInterface;
import gfx.core.UIComponent;
class com.scaleform.directional extends UIComponent {
// The entities, layers and controls of the minimap
public var directionshow:MovieClip;
public function directional() {
//
}
public function configUI():Void {
// Register compass values with the app
//
// Params:
// compass movieclip (this),
//
ExternalInterface.call("registerDcompassView", this);
}
}
GFxMinimapHud.uc 中的
function registerDcompassView(GFxDcompass dc)
{
GetPC().ClientMessage("DCopmass Registered");
Dcompass = dc;
Dcompass.Init(self);
Dcompass.SetVisible(false);
Dcompass.SetFloat("_xscale", 85);
Dcompass.SetFloat("_yscale", 85);
}
在将所有 swf 添加到内容浏览器并运行游戏后 添加了此代码 swf 确实出现在屏幕上 但代码不起作用 我没有收到 ClientMessage
hello
im trying to add a new element to the hud
its spoused to be a compass that should function like the minimap
Ive add this code to the main hud.swf
var DcompassContainer:MovieClip = this.createEmptyMovieClip("DcompassContainer", this.getNextHighestDepth());
DcompassContainer._x = 280;
DcompassContainer._y = 8;
DcompassContainer.loadMovie("udk_compass.swf");
so far all is good
this is the info on the main MC in flash
name directional
instence name directional
identifier directional
class com.scaleform.directional
in the class file
import flash.external.ExternalInterface;
import gfx.core.UIComponent;
class com.scaleform.directional extends UIComponent {
// The entities, layers and controls of the minimap
public var directionshow:MovieClip;
public function directional() {
//
}
public function configUI():Void {
// Register compass values with the app
//
// Params:
// compass movieclip (this),
//
ExternalInterface.call("registerDcompassView", this);
}
}
in the GFxMinimapHud.uc ive added this code
function registerDcompassView(GFxDcompass dc)
{
GetPC().ClientMessage("DCopmass Registered");
Dcompass = dc;
Dcompass.Init(self);
Dcompass.SetVisible(false);
Dcompass.SetFloat("_xscale", 85);
Dcompass.SetFloat("_yscale", 85);
}
after adding all swf to the content browser and running the game
the swf does appear on thew screen
but the code is not working
im not getting the ClientMessage
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论