首页 \ 问答 \ 画布中心等距地图?(Center isometric map in canvas?)

画布中心等距地图?(Center isometric map in canvas?)

我想知道如何设置画布来查看特定的网格点?

例如,我的等轴测图使用x:y坐标。 当我加载地图是一些关于画布,大约一半的..所以我想将相机的中心设置为地图的中心区域。 这样整个网格就可以在画布中查看。

img.onload = function(){
tiles_wide = 18; 
tiles_long = 19; 

for (i=0;i<tiles_wide;i++){ //horizontal

  for (j=0;j<tiles_long;j++){ // vertical

    var x = (i-j)*(img.height/2);
    var y = (i+j)*(img.height/4);

    ctx.drawImage(img,x,y);
        }
    }

}

希望有人可以帮忙:)


I was wondering how to set canvas to view a specific grid spot ?

For example, my isometric map uses x:y co ordinates. And when i load the map is some what off the canvas, about half of it.. so i want to set the center of the camera to the center tile of the map. So that the entire grid is viewable in the canvas.

img.onload = function(){
tiles_wide = 18; 
tiles_long = 19; 

for (i=0;i<tiles_wide;i++){ //horizontal

  for (j=0;j<tiles_long;j++){ // vertical

    var x = (i-j)*(img.height/2);
    var y = (i+j)*(img.height/4);

    ctx.drawImage(img,x,y);
        }
    }

}

Hope some one can help :)


原文:https://stackoverflow.com/questions/9439337
更新时间:2023-11-20 21:11

最满意答案

您可以使用IIS Admin Scripts查询服务器,然后根据需要启动它。

该脚本位于%systemroot%\system32

要查询服务器,只需从命令行运行IIsWeb.vbs /query w3svc/1

如果它没有运行,那么你可以运行IIsWeb.vbs /start w3svc/1来启动它。

这是一篇有关这些脚本的更多信息的文章


You can use the IIS Admin Scripts to query the server, and then start it if you need.

The script is located in %systemroot%\system32.

To query you server, just run IIsWeb.vbs /query w3svc/1 from a command line.

If it's not running, then you can run IIsWeb.vbs /start w3svc/1 to start it.

Here is an article with more information on these scripts.

相关问答

更多
  • 转到Start->Run键入inetmgr,然后按确定。 如果你得到一个IIS配置屏幕。 它被安装,否则它不是。 您还可以选中ControlPanel->Add Remove Programs ,单击Add Remove Windows Components并在已安装组件列表中查找IIS。 编辑 重新安装IIS。 Control Panel -> Add Remove Programs -> Click Add Remove Windows Components Uncheck IIS box 单击下一步 ...
  • 这是可行的。 要记住的是没有2个服务可以共享相同的端口和IP地址。 不幸的是,IIS在魔术0.0.0.0地址上完全接管了80端口。 你需要做的是重新绑定Apache和IIS到不同的IP地址以及删除0.0.0.0绑定。 不完全确定如何在IIS7上实现这一目标(假设您在运行IE9的情况下运行它),上一次我将这个特技IIS6拉高了。 一个更加理智的选择是在80上设置一个反向代理,并根据你想要使用的任何理性标准向不同的Web服务器发送消息。 编辑:发现魔术juju, IIS7后#44 - IIS7和Apache在同 ...
  • 我讨厌发表自己的答案,但最近有一些答案已经忽略了我在自己的问题中发布的解决方案,提出了一些不那么愚蠢的方法。 简而言之, 您根本不需要编辑任何Windows用户帐户权限 。 这样做只会引入风险。 该进程在IIS中完全受到使用继承权限的管理。 将修改/写入权限应用于正确的用户帐户 右键单击站点列表下方的域,然后选择编辑权限 在“ 安全”选项卡下,您将看到列出MACHINE_NAME\IIS_IUSRS 。 这意味着IIS自动对该目录具有只读权限(例如在站点中运行ASP.Net)。 您不需要编辑此条目 。 点击 ...
  • 是的,使用PowerShell很容易实现。 网上有很多样本和例子。 查看Windows PowerShell中的(IIS)管理Cmdlet ,尤其是Get-WebConfiguration和Get-WebConfigurationProperty 。 要获取有关Windows身份验证高级设置的信息,请使用: $windowsAuthFilter = "/system.WebServer/security/authentication/windowsAuthentication" $winKernel = ( ...
  • 我发现了问题。 我看了一下$ ENV {PATH}并注意到,即使我更新了系统变量并重新启动了IIS站点,也没有包含java的路径。 不幸的是,您需要重新启动IIS作为服务才能获取新的环境变量。 现在正在运作。 I found the problem. I took a look at $ENV{PATH} and noticed that the path to java was not included even after I updated system variables and restarted ...
  • IIS版本不会依赖于Windows版本(2008,2012 R2等)吗? 对于云服务,您可以控制Windows操作系统版本。 Wouldn't the IIS version depend on the version of Windows (2008, 2012 R2, etc.)? For Cloud Services, you control the Windows OS version.
  • 您可以使用IIS Admin Scripts查询服务器,然后根据需要启动它。 该脚本位于%systemroot%\system32 。 要查询服务器,只需从命令行运行IIsWeb.vbs /query w3svc/1 。 如果它没有运行,那么你可以运行IIsWeb.vbs /start w3svc/1来启动它。 这是一篇有关这些脚本的更多信息的文章 。 You can use the IIS Admin Scripts to query the server, and then start it if yo ...
  • HTTP.sys有一个跟踪事件记录器 。 有了这个,您可以确定请求是否甚至是在IIS中正确的应用程序池。 使用方向 作为最后的手段,Microsoft提供了一个名为Debug Diagnostic的工具。 如果没有其他选项,请使用此选项。 它将生成您选择的应用程序池的崩溃转储。 不容易通过,但它是一个领先。 使用方向 There is a trace event logger for HTTP.sys. With this you can determine if the request is even m ...
  • 只需阅读它已存在的Response并等待! Stream s = response.GetResponseStream(); StreamReader r = new StreamReader(s); string html = r.ReadToEnd(); // IIS7 if(html.Contains(@"
  • 我正在努力解决类似的问题 - 我没有任何连接,甚至无法连接到IIS的localhost。 结果我忘了以管理员身份打开IIS。 这解决了问题。 Turns out I needed to grant permission to the Application Pool that the application was using. The Application Pool's identity was NetworkService, so as so as I granted Network Service ...

相关文章

更多

最新问答

更多
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)
  • 是否可以嵌套hazelcast IMaps?(Is it possible to nest hazelcast IMaps? And whick side effects can I expect? Is it a good Idea anyway?)
  • UIViewAnimationOptionRepeat在两个动画之间暂停(UIViewAnimationOptionRepeat pausing in between two animations)
  • 在x-kendo-template中使用Razor查询(Using Razor query within x-kendo-template)
  • 在BeautifulSoup中替换文本而不转义(Replace text without escaping in BeautifulSoup)
  • 如何在存根或模拟不存在的方法时配置Rspec以引发错误?(How can I configure Rspec to raise error when stubbing or mocking non-existing methods?)
  • asp用javascript(asp with javascript)
  • “%()s”在sql查询中的含义是什么?(What does “%()s” means in sql query?)
  • 如何为其编辑的内容提供自定义UITableViewCell上下文?(How to give a custom UITableViewCell context of what it is editing?)
  • c ++十进制到二进制,然后使用操作,然后回到十进制(c++ Decimal to binary, then use operation, then back to decimal)
  • 以编程方式创建视频?(Create videos programmatically?)
  • 无法在BeautifulSoup中正确解析数据(Unable to parse data correctly in BeautifulSoup)
  • webform和mvc的区别 知乎
  • 如何使用wadl2java生成REST服务模板,其中POST / PUT方法具有参数?(How do you generate REST service template with wadl2java where POST/PUT methods have parameters?)
  • 我无法理解我的travis构建有什么问题(I am having trouble understanding what is wrong with my travis build)
  • iOS9 Scope Bar出现在Search Bar后面或旁边(iOS9 Scope Bar appears either behind or beside Search Bar)
  • 为什么开机慢上面还显示;Inetrnet,Explorer
  • 有关调用远程WCF服务的超时问题(Timeout Question about Invoking a Remote WCF Service)