• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

WebGL Code Snippets missing??

Explorer ,
Nov 28, 2019 Nov 28, 2019

Copy link to clipboard

Copied

In the Code Snippets panel, there are only two folders: One for Actionscript and one for HTML5 Canvas. However, there is no WebGL Folder to be found? I've also never seen this folder since using Animate.
I tried the "reset to default XML" and still, nothing appeared.

I also never use this panel (and I only recently jumped back into the program to see what's been updated after being away from it for a few years). So, as far as I know, I wouldn't have made any settings modifications to wipe it out. 

Up-to-date and running version 20.0.

Any idea how I get this folder and the WebGL snippets?

(Attached Screenshot of what I currently have)

1.jpg

TOPICS
Code , Error , Missing feature

Views

526

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 29, 2019 Nov 29, 2019

Hi.

 

Even when they were available in the previous releases, they were outdated. The WebGL API changed drastically since it was introduced.

 

For example: previously you would need this huge amount of code to add a click event to a Movie Clip instance called 'rec'.

 

this.rec = this.getChildByName("rec");

canvas.onclick = function(e)
{
    var boundingRect = this.rec.getBounds(this);
	
    if(isMouseOverSymbol(e.offsetX, e.offsetY, boundingRect))
	{
        console.log("click");
    }
}.bind(t
...

Votes

Translate

Translate
Guru ,
Nov 28, 2019 Nov 28, 2019

Copy link to clipboard

Copied

Hi mate, 

Same on my machine. 

In An 19.2.1 there are WebGL snippets. In An 20 they are missing.

 

Nick - Character Designer and Animator, Flash user since 1998
Member of the Flanimate Power Tools team - extensions for character animation

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2019 Nov 29, 2019

Copy link to clipboard

Copied

Thanks! Just glad to hear it isn't only my version and it's standard! I might give it a try if it looks like I might need um. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2019 Nov 29, 2019

Copy link to clipboard

Copied

Hi.

 

Even when they were available in the previous releases, they were outdated. The WebGL API changed drastically since it was introduced.

 

For example: previously you would need this huge amount of code to add a click event to a Movie Clip instance called 'rec'.

 

this.rec = this.getChildByName("rec");

canvas.onclick = function(e)
{
    var boundingRect = this.rec.getBounds(this);
	
    if(isMouseOverSymbol(e.offsetX, e.offsetY, boundingRect))
	{
        console.log("click");
    }
}.bind(this);

function isMouseOverSymbol(pointX, pointY, rect)
{
    if(rect.left <= pointX && pointX <= rect.left + rect.width)
        if(rect.top <= pointY && pointY <= rect.top + rect.height)
            return true;

    return false;
}

 

 

Now you only need this:

 

{
	var _this = this;

	_this.rec.addEventListener(AnEvent.CLICK, function ()
	{

		console.log("click");
	});
}

 

 

 

Currently what you can do is to use the wizard in the Actions Panel. The code added from the wizard is correct. You can also inspect the exported files and the browser console to find out more about the API while there isn't a official API documentation.

 

 

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2019 Nov 29, 2019

Copy link to clipboard

Copied

Thanks! I've been jumping around on tutorials that I'm now realizing are now completely outdated! I'll give this a try!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2019 Nov 30, 2019

Copy link to clipboard

Copied

LATEST

Nice! You're welcome! Please let us know if you need more help.

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2019 Nov 29, 2019

Copy link to clipboard

Copied

a

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines