• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript pixi.js.Graphics类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了js.Graphics类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: preparePlayer

 private preparePlayer( config: PlayerConfig ) {
   const graphics = new PIXI.Graphics();
   const half_size = config.size / 2;
   graphics.beginFill(config.color, 1);
   graphics.drawRect(-half_size, -half_size, config.size, config.size);
   graphics.x = config.position[0];
   graphics.y = config.position[1];
   return { view: graphics, config };
 }
开发者ID:KuKKoMaH,项目名称:tron-racing,代码行数:9,代码来源:Render.ts


示例3: fastFun

export function fastFun() {
    if (!Menu.fastBool) {
        if (Menu.editBool) {
            $("#editBulle").trigger("click");
        }
        Menu.disableButton($("#editBulle"));
        Menu.setBackground(Ressource.pathImgFast);
        $("#fastBulle").css({ "box-shadow": "lime 0px 0px 20px inset", "border-radius": "20px", "padding": "3px" })
        //$( "body" ).css({"border": "lime 1em dashed"})
        //renderer.transparent=true
        //console.log(renderer)
        var windowH = Rezo.windowH
        var windowW = Rezo.windowW
        sensorFast = new PIXI.Graphics();
        sensorFast.beginFill(0x00ff06, 0)
        sensorFast.drawRect(0, 0, windowW, windowH)
        sensorFast.hitArea = new PIXI.Rectangle(0, 0, windowW, windowH);
        sensorFast.interactive = true;
        var stage = Rezo.stage;
        stage.addChild(sensorFast)
        sensorFast.mousedown = sensorFast.touchstart = function (data) {
            data.data.originalEvent.preventDefault();
            this.data = data;
            console.log(this.data)
            var newPosition = this.data.data.getLocalPosition(this.parent);
            var newFastBulleText = prompt('Text nouvelle bulle')
            if (newFastBulleText) {
                updateWindowSize()
                var scaleScene = Rezo.scaleScene;
                var fastPoX = newPosition.x / scaleScene.scale.x - scaleScene.scene.x - (windowW / scaleScene.scale.x - windowW) / 2
                var fastPoY = newPosition.y / scaleScene.scale.x - scaleScene.scene.y - (windowH / scaleScene.scale.x - windowH) / 2
                Rezo.sceneBulle.addChild(new Bulle(fastPoX, fastPoY, newFastBulleText, Bulle.bulleColor));
                Link.linkBool = true
                Link.link3Bool = true
                Link.link2Bool = false

                Link.linkFun()
            }



        }
        Menu.fastBool = true
    } else {
        Menu.enableButton($("#editBulle"), Menu.editButton)
        Menu.setBackground();
        $("body").css({ "border": "0em" });
        $("#fastBulle").css({ "box-shadow": "none", "border-radius": "20px", "padding": "0px" });
        //console.log(renderer)
        Rezo.stage.removeChild(sensorFast);
        Link.linkBool = false;
        Link.link3Bool = false;
        Link.emptyLinkArray();
        //sceneBulle.mousedown = sceneBulle.touchstart = function () { };
        Menu.fastBool = false
    }
}
开发者ID:AntoineGermanique,项目名称:REZO_TYPESCRIPT,代码行数:57,代码来源:fast.ts


示例4: 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


示例5: 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类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript pixi.js.Texture类代码示例发布时间:2022-05-25
下一篇:
TypeScript pixi.js.Container类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap