当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript js.Graphics.lineStyle方法代码示例

本文整理汇总了TypeScript中pixi.js.Graphics.lineStyle方法的典型用法代码示例。如果您正苦于以下问题:TypeScript js.Graphics.lineStyle方法的具体用法?TypeScript js.Graphics.lineStyle怎么用?TypeScript js.Graphics.lineStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pixi.js.Graphics的用法示例。


在下文中一共展示了js.Graphics.lineStyle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

	constructor(game: Game) {
		super(game);
		let test = new Graphics();
		test.lineStyle(4, 0x10fa01,1);
		test.drawCircle(10,10,50);
		this.container.addChild(test);
	}
开发者ID:fbessou,项目名称:gooms-server,代码行数:7,代码来源:mainmenu.ts

示例2: setLocator

    private setLocator(): Graphics {
        const context = new Graphics;
        context
            .lineStyle(0.1, 0xFF0000, 1)
            .moveTo(this.x, this.y)
            .lineTo(1, this.y)

            .lineStyle(0.1, 0x0000FF, 1)
            .moveTo(this.x, this.y)
            .lineTo(this.x, 1);
        return context
    }
开发者ID:SonyStone,项目名称:atanki-com,代码行数:12,代码来源:Locator.ts

示例3: constructor

	constructor (label: (string | (string | Item)[]), width: number, hint?: string, disabled: boolean = false) {
		super()

		const contentWidth = width // TODO MUST ACCOUNT FOR PADDING AND BORDER

		if (typeof label === 'string') {
			label = [label]
		}
		const textContainer = this.makeTextContainer(label, contentWidth)
		textContainer.x = (contentWidth / 2) - (textContainer.width / 2)
		textContainer.y = BORDER_WIDTH + PADDING

		const graphics: Graphics = new Graphics()
		if (disabled) {
			graphics.beginFill(DB16.LIGHT_GRAY)
		} else {
			graphics.beginFill(DB16.WHITE)
		}
		graphics.drawRect(
				BORDER_WIDTH,
				BORDER_WIDTH,
				width - 2 * BORDER_WIDTH,
				textContainer.height + 2 * PADDING,
		)

		const innerHeight = textContainer.height + 2 * PADDING
		graphics.lineStyle(BORDER_WIDTH, DB16.DARK_GRAY)
		// Top
		graphics.moveTo(BORDER_WIDTH, BORDER_WIDTH / 2)
		graphics.lineTo(width - BORDER_WIDTH, BORDER_WIDTH / 2)
		// Bottom
		graphics.moveTo(BORDER_WIDTH, innerHeight + BORDER_WIDTH + BORDER_WIDTH / 2)
		graphics.lineTo(width - BORDER_WIDTH, innerHeight + BORDER_WIDTH + BORDER_WIDTH / 2)
		// Left
		graphics.moveTo(BORDER_WIDTH / 2, BORDER_WIDTH)
		graphics.lineTo(BORDER_WIDTH / 2, innerHeight + BORDER_WIDTH)
		// Right
		graphics.moveTo(width - BORDER_WIDTH / 2, BORDER_WIDTH)
		graphics.lineTo(width - BORDER_WIDTH / 2, innerHeight + BORDER_WIDTH)

		this.addChild(graphics)
		this.addChild(textContainer)

		if (hint) {
			const hintText = new Text(hint, HINT_STYLE)
			hintText.x = textContainer.x - hintText.width - PADDING
			hintText.y = BORDER_WIDTH + (innerHeight / 2) - (hintText.height / 2)
			this.addChild(hintText)
		}
	}
开发者ID:bteixeira,项目名称:phaser-tryouts,代码行数:50,代码来源:ui-button.ts


注:本文中的pixi.js.Graphics.lineStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。