小编Joh*_*son的帖子

在TypeScript中使用单个模块生成声明文件

鉴于以下文件夹结构:

src/
??? foo.ts
??? bar.ts
??? baz.ts
??? index.ts
Run Code Online (Sandbox Code Playgroud)

其中foo.tsbar.tsbaz.ts每个都导出一个默认类或事物:即在以下情况下foo.ts

export default class Foo {
    x = 2;
}
Run Code Online (Sandbox Code Playgroud)

我们可以自动生成该声明的声明文件,一个模块 my-module和出口foo.tsbar.ts以及baz.ts作为非默认

即我想tsc生成以下内容:

build/
??? foo.js
??? bar.js
??? baz.js
??? index.js
??? index.d.ts
Run Code Online (Sandbox Code Playgroud)

其中index.d.ts包含:

declare module 'my-module' {
    export class Foo {
        ...
    }
    export class Bar {
        ...
    }
    export class Baz {
        ... …
Run Code Online (Sandbox Code Playgroud)

npm type-declaration typescript

9
推荐指数
1
解决办法
2085
查看次数

Change and scale resolution of XNA game

我有一个游戏,初始化为1920x1080.所有精灵,矢量等都特别正确放置,以匹配1920x1080类型.

我有一个enum,说明什么res,游戏被告知使用.1920x1080将成为标准.有没有办法,比方说,分辨率为1280x960,就这样:

  • 游戏窗口是1280x960
  • 游戏分辨率(后备缓冲区)仍然是1920x1080,但缩小到适合窗口 - 1280x960.

有点像,在绘制事件之前,将屏幕捕获到a中Texture2D,并正确显示它以适合游戏窗口.

c# xna resolution

2
推荐指数
1
解决办法
2109
查看次数

标签 统计

c# ×1

npm ×1

resolution ×1

type-declaration ×1

typescript ×1

xna ×1