Flash/Flashdevelop AS3 - 窗口比我在属性中设置的大 [英] Flash/Flashdevelop AS3 - Window is larger than what I set in Properties

查看:25
本文介绍了Flash/Flashdevelop AS3 - 窗口比我在属性中设置的大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 FlashDevelop 中制作游戏.我已将 Project -> Properties 中的 Dimensions 设置为 600 x 600.

I'm making a game in FlashDevelop. I've set the Dimensions in Project -> Properties to 600 x 600.

只有,当我运行它时,我得到这个:http://i.imgur.com/L4xsz7d.png

Only, when I run it, I get this: http://i.imgur.com/L4xsz7d.png

看起来还行吧?除了它是 750 x 750,而不是 600 x 600.

Looks okay, right? Except it's 750 x 750, not 600 x 600.

我早些时候注意到了这一点,但认为这只是 FlashDevelop 的一个怪癖和继续编程......直到现在.

I noticed this earlier but figured this was just a quirk with FlashDevelop and continued programming... up to now.

我的游戏快完成了,你看,所以我把它上传到 FGL.com 以供同行评审等等.当我在那里运行它时,这就是我得到的:http://i.imgur.com/Xtzy0Wp.png

My game is nearly finished, you see, so I've uploaded it to FGL.com for peer review and whatnot. When I run it there, this is what I get: http://i.imgur.com/Xtzy0Wp.png

仍然是一个 750 x 750 的窗口,但现在我的游戏没有被拉伸来填充它,所以侧面和底部有一个丑陋的边框.

Still a 750 x 750 window, but now my game isn't stretched to fill it so there's an ugly border on the side and the bottom.

我不知道是什么原因导致了这个问题,而且我在互联网上找不到任何其他人曾经遇到过这个问题的证据.我找到的最接近答案的是插入这一行:

I have no idea what could possibly be causing this, and I can't find any evidence of anyone else on the internet ever having this problem. The closest thing to an answer I found was to insert this line:

[SWF(width = "600", height = "600")]

[SWF(width = "600", height = "600")]

但这没有用.

我很沮丧.我的第一个游戏几乎完成了,但我遇到了这个完全毁了它的愚蠢问题,我不知道该怎么办.我只知道这要么是我遗漏的一些愚蠢而明显的事情,要么是以前没有人经历过的极其复杂的事情.我的情况似乎就是这样.

I'm so frustrated. My first game is almost complete, but I've run into this dumb issue that completely ruins it and I have no idea what to do about it. I just know that it's either some stupidly obvious thing that I'm missing, or it's something horribly complicated that nobody has ever experienced before. That seems to be how it goes with me.

推荐答案

没关系,我想出了一个解决方法.

Nevermind, I figured out a workaround.

我将此添加到标题屏幕,所有内容都是其子项:

I added this to the title screen, which everything is a child of:

if (stage.stageWidth >=stage.stageHeight) 
{
  this.scaleY=stage.stageHeight / 600;
  this.scaleX=stage.stageHeight / 600;
}
else 
{
  this.scaleY=stage.stageWidth / 600;
  this.scaleX=stage.stageWidth / 600;
}

它只是缩放整个游戏以适应窗口,无论窗口大小.

It just scales the whole game to fit the window, whatever size it may be.

这篇关于Flash/Flashdevelop AS3 - 窗口比我在属性中设置的大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆