≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Guest's scripts and plugins
Posted by:
(you are not logged in)
Enter the missing letter in: "Inter?ational"
(you are not logged in)
Text:
[quote][b]Guest[/b] wrote: Here's a version of my mouse behavior that uses a switch instead of if statements. Looks cleaner, imo. [code] // This is a CopperCube behavior for declaring mouse events /* <behavior jsname="behavior_DeclareMouseEvents" description="Declare mouse events"> <property name="ActionOnLMBDown" type="action" /> <property name="ActionOnLMBUp" type="action" /> <property name="ActionOnRMBDown" type="action" /> <property name="ActionOnRMBUp" type="action" /> </behavior> */ behavior_DeclareMouseEvents = function () { } behavior_DeclareMouseEvents.prototype.onAnimate = function () { } behavior_DeclareMouseEvents.prototype.onMouseEvent = function (button) { switch (button) { case 2: ccbInvokeAction(this.ActionOnLMBUp); break; case 3: ccbInvokeAction(this.ActionOnLMBDown); break; case 4: ccbInvokeAction(this.ActionOnRMBUp); break; case 5: ccbInvokeAction(this.ActionOnRMBDown); break; default: // Do nothing break; } } [/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