≡
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: "Internat?onal"
(you are not logged in)
Text:
[quote][b][/b] wrote: [b]just_in_case[/b] Thank you for your nice words. I help others so i can learn from doing it.. i get good ideas out of helping others to solve their scripting problems. [b]dekon_17[/b] This should do the trick: now you can choose color in editor. [code] /* <behavior jsname="behavior_rectWithColor" description="behavior_rectWithColor"> <property name="StartPoint" type="scenenode"/> <property name="EndPoint" type="scenenode"/> <property name="Rcolor" type="color" default="ffffffffff" /> </behavior> */ behavior_rectWithColor = function() { var me = this; this.registeredFunction = function() {me.DrawFunc();}; ccbRegisterOnFrameEvent(this.registeredFunction); } behavior_rectWithColor.prototype.onAnimate = function() { } behavior_rectWithColor.prototype.DrawFunc = function() { var Pos2D=0; 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 (Col == null) { Pos2D = ccbGet2DPosFrom3DPos(EP.x, EP.y, EP.z); } else if (Col) { Pos2D = ccbGet2DPosFrom3DPos(Col.x, Col.y, Col.z); }; ccbDrawColoredRectangle(this.Rcolor, Pos2D.x - 30, Pos2D.y - 2, Pos2D.x - 10, Pos2D.y + 2); ccbDrawColoredRectangle(this.Rcolor, Pos2D.x + 10, Pos2D.y - 2, Pos2D.x + 30, Pos2D.y + 2); ccbDrawColoredRectangle(this.Rcolor, Pos2D.x - 2, Pos2D.y + 10, Pos2D.x + 2, Pos2D.y + 30); } [/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