≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Problem with drawn rectangle
Posted by:
(you are not logged in)
Enter the missing letter in: "?nternational"
(you are not logged in)
Text:
[quote][b]dekon_17[/b] wrote: The previously drawn (by my script) rectangles aren't disappearing, so, this is what I get as a result after the pistol inspection animation plays in the begining of a level: [img]https://i.postimg.cc/P5bKW137/image.png[/img] So... How do I make them disappear after a new one is created on screen? Also, to better understand this, here's the code: [code]/* <behavior jsname="behavior_aim" description="Look how bullet will fly"> <property name="StartPoint" type="scenenode"/> <property name="EndPoint" type="scenenode"/> <property name="Crosshair" type="texture"/> <property name="Crosshair_Size_X" type="float"/> <property name="Crosshair_Size_Y" type="float"/> </behavior> */ behavior_aim = function() { }; behavior_aim.prototype.onAnimate = function() { var SP = ccbGetSceneNodeProperty(this.StartPoint, "PositionAbs"); var EP = ccbGetSceneNodeProperty(this.EndPoint, "PositionAbs"); var Col = ccbGetCollisionPointOfWorldWithLine(SP.x, SP.y, SP.z, EP.x, EP.y, EP.z); if (this.Col == null) { var Pos2D = ccbGet2DPosFrom3DPos(EP.x, EP.y, EP.z); } else { var Pos2D = ccbGet2DPosFrom3DPos(Col.x, Col.y, Col.z); }; function onFrameDrawing() { ccbDrawColoredRectangle(0x77ff0000, Pos2D.x - 100, Pos2D.y - 100, Pos2D.x + 100, Pos2D.y + 100); } ccbRegisterOnFrameEvent(onFrameDrawing); }[/code][/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact