≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Extended Javascript API and Showcase
Posted by:
(you are not logged in)
Enter the missing letter in: "Internation?l"
(you are not logged in)
Text:
[quote][b]just_in_case[/b] wrote: I am reserving this thread to post my developer log for the extended javascript API that I am creating for CopperCube, Hopefully, @niko will add all of them to the engine in future updates. I will be posting list of stuff that I have already done in extending the API. I am going to post API command and what they will do. here is the list:- [code][b]ccbSetMousePos(X,Y)[/b][/code] Sets cursor position to a location on the game screen [code][b]ccbGetAnimatedJointCount(animatednode)[/b] [/code]Returns the number of bones(joint) of an animated scenenode [code][b]ccbGetAnimatedJointName(animatednode,jointIndex)[/b][/code] returns the name of the bone(joint) of an animated scenenode, joint index is the index of bone it should be less than the AnimatedJointCount [code][b]ccbGetCurrentAnimationFrame(animatednode)[/b][/code] Return the current animation frame playing in the scene by the animated scenenode [code][b]ccbRenderToTexture(node, material index, camera, X resolution, Y resolution)[/b][/code] captures the scene from the provided camera's view and will apply it as a texture to the supplied node on the supplied material index. X and Y resolution shares the same buffer as screen, so it will be much better if you use your scrwidth and scrheight for X and Y res. [code][b]ccbGetTextureWidth(texture)[/b][/code] returns the size of the provided texture (width only). [code][b]ccbGetTextureHeight(texture)[/b][/code] returns the size of the provided texture (Height only). [code][b]ccbSetDopplerEffectParameters(DopplerFactor, DistanceFactor)[/b][/code] Allows you set the DopplerEffect to a different value, default is (1.0,1.0) that Coppercube uses. Works for 3D sounds haven't tested it with 2D sounds. The value ranges from 1.0 to 10.0. This gives a nice effect for fast-moving objects like cars, missiles, or maybe if you add bullet sounds. [code][b]ccbPauseAllSounds(bool)[/b][/code] Pause and unpause all the currently playing sounds, depending on the boolean(true/false) provided. [code][b]ccbSplitScreen(cam1,x1,y1,x2,y2, cam2,x3,y3,x4,y4)[/b][/code] Allows you to split the screen into 2 camera views, you can specify the viewport coordinates for each camera marked as X and Y, Coordinates help in creating, a vertical split or horizontal split, at least one of them needs to be an active camera. This is not the same as ccbRenderToTarget(). This command needs to be executed in onFrameEvent. [code][b]ccbSetAnimationFromSceneNode(node1, node2, animationname)[/b][/code] Allows you to apply animations from node2 to node1, if they share the same skeleton(rig), super useful for people who work with Mixamo, now they don't have to apply animations individually to all of their animated nodes. Just apply all the animations to a single node and use the API command to apply the animation from that node to other nodes that use the same skeleton rig. ( Just added another parameter to it, you can now also define the animation name, that you want to play from another node). More API will be added to the list.*holy* [b] Upgrades[/b] Here goes the list of upgrades that I will be doing to the inbuild nodes and behaviors. [code][b]PlaybackSpeed[/b][/code] Added Playback speed attribute to the built-in SoundNode. You can now use it to play a sound faster or slower, It also automatically changes the pitch accordingly. Can be used to change pitch during runtime Like after the player drinks a poison, SlowDown the playback speed of sound, and many more. [code][b]Pause[/b][/code] Added Pause and Unpause boolean to the default sound node, Allow us to pause and unpause that specific node's sound during runtime. But there are bugs with these upgrades, so not sure if they will make it to the release version. The only bug is It captures only one single sound node in the scene and doesn't detect attributes for multiple nodes. It can be an issue of the debug deploy, but maybe @Niko knows if it will get fixed automatically when deployed as a release. More upgrades will be added to the list.*holy*[/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