调整从Unity3d导出的外部SWF的大小

发布于 2024-12-25 18:03:15 字数 766 浏览 4 评论 0原文

我使用 Unity3D 3.5 预览导出了 swf。

当我加载 as3 (Adobe Air 3) 时,我无法更改尺寸。

当swf加载时出现unity with loading的标志,大小调整为730x750!太好了,好吧!但是,当 Unity 加载程序结束时,swf 会根据舞台大小 (1920x1080) 调整大小。 =/

我在Unity3D中将分辨率设置为730x750。

有什么想法吗?谢了!

我的as3代码:

    public function mc_produto_swf() 
    {
        var loader:Loader = new Loader();
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
        var url:URLRequest = new URLRequest("Sapato_01.swf");
        loader.load(url);
    }

    public function loaderComplete(event:Event):void
    { 
        var cont:MovieClip = MovieClip(event.currentTarget.content);
        cont.width = 730;
        cont.height = 750;

        this.addChild( cont );
    }

I exported a swf using Unity3D 3.5 preview.

I can not change the dimensions when I load in as3 (Adobe Air 3).

When the swf loads appears the logo of unity with loading, that resizes to 730x750! Great ok! But when the loader of unity ends the swf resize for the stage size (1920x1080). =/

I set the resolution to 730x750 in Unity3D.

Any ideas? Tks!

My code in as3:

    public function mc_produto_swf() 
    {
        var loader:Loader = new Loader();
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
        var url:URLRequest = new URLRequest("Sapato_01.swf");
        loader.load(url);
    }

    public function loaderComplete(event:Event):void
    { 
        var cont:MovieClip = MovieClip(event.currentTarget.content);
        cont.width = 730;
        cont.height = 750;

        this.addChild( cont );
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

注定孤独终老 2025-01-01 18:03:15

我在 Unity3d 论坛中发布了同样的问题,用户“UnityRalph”帮助我:

我们的内容并不是真正可调整大小的显示对象,因为它使用 Stage3D(不过,考虑一下,我们可能可以使其采用显示列表宽度、高度、x、y)。

现在您可以做的是UnityShared.swc:http://forum.unity3d.com/threads/116650-UnityShared.swc-Communicating- Between-Unity-Flash-Content-and-AS3

您可以从 SWC 使用的加载程序允许指定大小和阶段大小。

对我有用,但我尝试改变位置 x 但不起作用。

I post the same question in the Unity3d forums and the user "UnityRalph" help me:

Our content isn't really a resizable display object as it uses Stage3D (we probably could make it take displaylist width, height, x, y, though, thinking about it).

For now what you can do is UnityShared.swc: http://forum.unity3d.com/threads/116650-UnityShared.swc-Communicating-between-Unity-Flash-Content-and-AS3

The loader you can use from the swc allows specification of size and stage to size or not.

Works for me, but i tried change the position x and not work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文