Monday , 20 November 2017
Home / Programming (page 3)

Programming

Global Properties – Advanced JavaScript Tutorial

Global Properties

There are 2 global properties you can use to apply to your drawings. This the alpha and composition properties. They can truly effect the outcome of all your drawings. Alpha Clear your script and add this bit of code. [crayon-5a123c8753019258043365/] In the example above, we draw a rectangle with the default settings. Next, we change the globalAlpha property. This property …

Read More »

Gradients – Advanced JavaScript Tutorial

Gradients

Gradients allow you to create fills with multiple colors. Not only that, it takes care of transitioning from 1 color to the next. There are 2 kinds of gradients which are linear and radial. We’ll learn how to do both in this tutorial. Linear Gradients Clear your script and add this bit of code. [crayon-5a123c875480d892070099/] Alright a couple of things …

Read More »

Shadows – Advanced JavaScript Tutorial

Shadows

Shadows are a great way to make your 2D drawings pop out. They’re very easy to set up and you’re given a couple properties to get you started. Clear your script and add this bit of code. [crayon-5a123c8754ef4269669282/] In the above example we use the 4 main shadow properties and draw a green rectangle onto the canvas. Let’s focus on …

Read More »

Drawing Images – Advanced JavaScript Tutorial

Drawing Images

If you would like to add your own images into the canvas, then you only have to write a couple lines of code to do so. There are a couple of ways of drawing images onto the canvas, but we’ll be using 1 way which is the image object. Please feel free to download the images I use in this …

Read More »

Transformations – Advanced JavaScript Tutorial

Transformations

Transformations allow you to add cool effects to your drawings. This tutorial will cover that and we’ll fix the problem with fuzzy drawings. Fixing Fuzzy Drawings Previously, we set the width and height of the canvas using CSS. This is the wrong way to do things as it can actually stretch our drawings and make it appear fuzzy and blurry. …

Read More »

Text API – Advanced JavaScript Tutorial

Text API

In this tutorial, we’ll take a look at how to add text to our canvas. It’s actually quite simple. You’re given many options to set up how the text appears. Let’s update our script to this. [crayon-5a123c875620a154404571/] There are 2 methods to add text to the canvas. They are the fillText() and strokeText() methods. Both of these methods have the …

Read More »

Path API – Advanced JavaScript Tutorial

Path API

The path API allows you draw custom shapes with paths.  You can create some really complex shapes and drawings with this API as it comes with powerful methods. Lines Clear your script and add this bit of code. [crayon-5a123c87570f2032649220/] So, we first set up the stroke color and set it’s with to 2 pixels. Now, we can start drawing some …

Read More »

Canvas – Advanced JavaScript Tutorial

Canvas

Since the introduction of HTML5, the <canvas> tag has grown a great amount of popularity. The <canvas> element allows you to draw graphics onto the document with JavaScript. To get started, let’s update our document to this. [crayon-5a123c8758641667054188/] The very first thing we must do is create <canvas> tags. This is where all our graphics will be placed. You MUST …

Read More »

Text Fields – Advanced JavaScript Tutorial

Text Fields

In this tutorial, we’ll focus on text fields in our forms. There a couple of events, properties and methods to make working with forms easier. Selecting Text Let’s update our document to this. [crayon-5a123c87595cb785697613/] Alright, let’s clear out our script and add this bit of code. [crayon-5a123c8759606317643360/] In our third line, we use a method called select(). This method will …

Read More »

Form Events – Advanced JavaScript Tutorial

Form Events

If you’ve seen my JavaScript tutorial series, then you already know how to work with forms. In this tutorial, we’ll talk a little more about form events  and how to manipulate them with JavaScript. Setting Up The Document Let’s update the body tags to this. [crayon-5a123c875a0f9928011110/] We just have a basic form with some input fields. You should remember that …

Read More »
ULTIMATE WORDPRESS DEVELOPMENT COURSE
Want to learn how to create your own custom WordPress plugins and themes? Check out my course!
Get 93% off my course. You'll also learn how to integrate WooCommerce and BuddyPress into your projects. This is a limited time offer
Yes, I would like to get 93% off your course!
No Thanks!
close-link