Crafty Beyond the Basics: Collisions

It is very important in a game that you detect collisions properly. Nobody is going to play a game where things start exploding even when they are many pixels apart. Besides the graphics and sounds, this is one more thing that you should try to keep as accurate as possible.

In this tutorial, you will learn about detecting and debugging collisions in detail.

Detecting and Ignoring Hits

Before you can detect any collisions, you need to add the Collision component to an entity. This component will successfully detect a collision between any two convex polygons. This component has two events: HitOn and HitOff. The HitOn event is triggered when a collision occurs. It will not be triggered again unless collisions of that specific type cease. The HitOff event is triggered when a collision ceases.

If you are checking for collision with multiple components and all these collisions occur simultaneously, each collision will fire its own HitOn event. The data received from a collision event is only valid as long as the collision is still occurring.

You can use the .checkHits() method to perform collision checks against all entities with a specified component. Calling this method multiple times will not result in multiple redundant checks. 

Keep in mind that hit checks are performed upon entering each new frame. Let’s say there are two objects which have not yet collided when the hit check is performed. Now, if one of the objects moves to a new location and overlaps with the second object later in the same frame, the hit events will not be fired until a collision check is performed again in the next frame.

If you have to detect only the first collision between different entities, you can use the .ignoreHits(String componentList) method. The componentList variable is a comma-separated list of components with which you no longer want to detect collisions. When no arguments are provided, it will stop collision detection with all entities. Here is an example:

littleBox.bind("HitOn", function(hitData) {
  Crafty("Obstacle").color('red');
  this.ignoreHits('Obstacle');
});

You can see that Crafty not only starts detecting the HitOn event but also the HitOff event. That’s why the color of the big box does not change back to black.

Another similar method called .resetHitChecks(String componentList) can be used to re-check for collision between specific components. This method will keep firing the HitOn event again and again as long as the collision is still happening.

Debugging Collisions

When entities are moving continuously, it is very hard to see if the collisions are being fired at the right time. In the above demo, it looks as if the HitOn event is firing slightly before the actual event. Crafty gives you the option of drawing hit boxes around entities so that you can actually see what’s going on. 

There are two components that you can use for debugging purposes. These are WiredHitBox and SoldHitBox

The first component will allow you to use the .debugStroke([String strokeColor]) method, which will draw an outline around the entity with a given color. When no color is provided, the color red is used to draw the outline. 

Similarly, the second component is used to fill the entities with a given color using the .debugFill([String fillStyle]) method. When no color is provided, the color red is used. Here is a demo with the .debugStroke() method.

Creating a Custom Hit Box

You can also create a custom hit box for collision detection. This is helpful when you are using image sprites in your game that are not rectangular. The .collision() method that you can use to create a custom hit area accepts a single parameter that is used to set the coordinates of the new hit box. 

These coordinates can be supplied in the form of a polygon object, an array of x,y coordinate pairs, or a list of x,y coordinate pairs. The points of the polygon are marked in a clockwise manner, and they are positioned relative to the unrotated state of our entity. The custom hit area will automatically rotate itself when the entity rotates. 

There are a few things that you should keep in mind when using custom hit areas. The hit area that you define should form a convex polygon for the collision detection to work properly. For those who are unfamiliar with the term, a convex polygon is a polygon with all of the interior angles less than 180°. You might also see slight performance degradation when the hit area that you defined lies outside the entity itself.

The custom hit area that you defined won’t have any effect unless you add the Collision component to every entity with which your hit area needs to detect a collision.

littleBox.collision(80, 0,  100, 100,  50, 100)
  .debugStroke('green')
  .checkHits('Obstacle');

In the above demo, we have defined a custom hit box that lies outside the orange box. As you can see, the big block turns blue only when it collides with the triangle. The position of the orange box doesn’t matter.

Let’s take a look at another example which uses a spaceship by Gumichan01. The default hit box for the spaceship is the boundary of the sprite itself. In the current scenario, the top right corner of the spaceship touches the block first, but that space is actually empty. For users who are playing your game, this is a case of bad collision detection.

What you can do here is define your own hit area using a triangular shape like the following code. The custom hit box polygon that you define can have as many sides as you want. Just make sure that it is still a convex polygon.

spaceShip.collision(8, 0, 0, 48, 70, 48);

Conclusion

After completing all these tutorials, you should now be able to create your own little games with great graphics, nice sound effects, scenes, and collision detection. I should remind you that I have used Crafty version 0.7.1 in this tutorial, and the demos might not work with other versions of the library. 

JavaScript has become one of the de-facto languages of working on the web. It’s not without it’s learning curves, and there are plenty of frameworks and libraries to keep you busy, as well. If you’re looking for additional resources to study or to use in your work, check out what we have available in the Envato marketplace.

If you have any questions, let me know in the comments.

View Tutorial: Crafty Beyond the Basics: Collisions

How to Create a Western Text Effect in Adobe Illustrator

What You’ll Be CreatingIn the following steps you will learn how to create a simple Western text effect in Adobe Illustrator. For starters you will learn how to create a simple background and how to add a basic piece of text. Taking full advantage…

View Tutorial: How to Create a Western Text Effect in Adobe Illustrator

RSVP for Events With These WordPress Plugins

Adding events to your WordPress website is simple enough; there are several excellent calendar plugins to choose from. But to take things to the next level, adding event registration capabilities will bring another layer of functionality and convenience. Event registrations and RSVPs are also a great way to increase customer interaction and loyalty.

Let’s review some things to consider when utilizing event registration on your own website. We’ll also check out some WordPress plugins to help you make it happen. There are great solutions for virtually every type of event; whether you charge for them or not.

1. Attendee Lists are Useful for Like-Minded Communities

If you’re involved with a group that meets around a specific topic like coding, hiking or even knitting, displaying a list of registered attendees along with your event can encourage others to sign up. In the world of WordPress, this functionality is often added to WordCamp websites. It’s always exciting to see who else will be joining you at an event.

Events Plus is a full event suite that enables users to register for events on your site. From there, you can display a list of attendees via a WordPress Shortcode on any page or post. Use the plugin to create multiple ticket types (free or paid) and offer discount codes.

Events Calendar Registration  Booking
Events Calendar Registration & Booking

2. WooCommerce Integration Makes Order Management Easy

There are some real benefits to an event registration plugin that works with WooCommerce. For one, if you already have an online store, all of your orders will be seen in the same place. This also means that you can use any payment method supported by WooCommerce for your events. Bringing all of your transactions under a single umbrella will make for easier management.

Modern Events Calendar works in conjunction with WooCommerce for event registrations. It also integrates with other popular services and plugins like MailChimp, Google Maps and BuddyPress. You can take advantage of these integrations for better functionality and data gathering.

Modern Events Calendar - Responsive Event Scheduler  Booking For WordPress
Modern Events Calendar – Responsive Event Scheduler & Booking For WordPress

3. Importing Events from Outside Sources Adds Convenience

Perhaps your organization uses a service like Google Calendar internally, but wants to integrate some or all of those events into WordPress so that users can register for them. Or you might have a salon where each stylist uses their own separate calendar. Regardless, it’s both possible and worthwhile to create a single calendar that pulls in events from multiple sources. This gives users one place to register for events or book appointments without the need for hopping around multiple sites and maintaining multiple accounts.

With VR Calendar Sync Pro, you can create multiple calendars (up to ten), each synced from up to five sources. It syncs with Google Calendar, VRBO, Airbnb, Flipkey and Homeaway, so it’s great for managing rental or vacation properties. But it can also be of benefit to any business that book appointments, or that needs to import events from outside sources. PayPal and Stripe are supported for paid registrations.

VR Calendar Sync Pro - Responsive Booking Plugin
VR Calendar Sync Pro – Responsive Booking Plugin

4. Limiting Registrations Encourages Users to Act Quickly

The basic economic principle of supply and demand certainly applies to events. Displaying the amount of seats currently available for your event provides incentive for prospective attendees to make sure they’ve locked up their own spot. After all, no one wants to see that an event is sold out before getting around to making a reservation.

EventCommerce lets you add registration limits to your events and will display the amount of seats currently available on the frontend of your site. The plugin is quite flexible and can be used for just about any type of event, even appointment booking. Multiple calendar views help you create a registration system that truly fits your needs.

EventCommerce WP Responsive Event Calendar Pro
EventCommerce WP Responsive Event Calendar Pro

5. Sending Event Reminders Offers Peace of Mind

Have you ever signed up for an event only to stress out about the details? Event reminders can help to assure attendees that their registration is on file and also inform them of any pertinent information they’ll need to know. It saves them extra trips to your website and it may just save you from having to answer a few inquiries.

Booki is a WordPress booking plugin that lets you create custom event reminder emails. Email templates can be customized to match your brand. You’ll also be able to automatically or manually confirm registrations–handy for those who want to book appointments online with an extra measure of control.

Booki - WordPress Booking Calendar plugin for reservations and appointments
Booki – WordPress Booking Calendar plugin for reservations and appointments

Supercharge Your Events and Your Business

Utilizing an event registration system on your website is an effective way to help build your business. You’ll encourage customers to visit your site more often to check out what’s going on. Plus, you’ll get to know them better through both personal interaction and the data you collect during the registration process. It’s a simple way to build lasting relationships that can enrich you both personally and professionally.

View Tutorial: RSVP for Events With These WordPress Plugins

Photoshop in 60 Seconds: Create a Pearl Necklace With the Mixer Brush in Photoshop

Final product image
What You’ll Be Creating

Welcome to our Photoshop in 60 Seconds series, in which you can
learn a Photoshop skill, feature, or technique in just a minute!

Photoshop in 60 Seconds: Custom Jewelry

The Mixer Brush Tool, in Adobe Photoshop, allows you to make awesome stamps of any object. And in this quick tutorial, I’ll be using this neat tool to show you how to create a pretty pearl necklace by creating your own necklace brush.

Feel free to download the pearl and woman stocks used in this video. And browse the incredible collection of stock photography on PhotoDune for more amazing references.

 

How to Create a Custom Necklace in Photoshop

Open your photos into Photoshop. Here I’ll be using these pearl and woman stocks.

Pearls and Woman References

First, extract one pearl from the bracelet using the Elliptical Marquee Tool (M). Then Control-J to Duplicate it, resizing the copy to be smaller with the Free Transform Tool (Control-T). The second pearl will serve as a small connector piece.

Duplicate and Resize the Pearl

Merge both pearl layers together. Select the Mixer Brush Tool (B) and increase the Brush Size to fit over both pearls, and then hold the Alt key to load the pearls as a new brush. Hit F5 to adjust the settings in the Brush panel as follows:

  • Spacing: 90-95%
  • Shape Dynamics: Checked, Angle Control: Initial Direction
Mixer Brush Settings

With the Mixer Brush (B) selected, begin drawing a pearl necklace across your subject. You may need to try it several times to get it just right. Then set a Layer Mask to the pearl necklace and paint black onto the mask to hide any imperfections or pearls with the Brush Tool (B).

Mask Out the Extra Pearls

Almost done! Now Right-click the layer to go to Blending Options. Set a Drop Shadow to the necklace with the following settings:

Drop Shadow Blending Option Settings

Feel free to continue tweaking the lighting or colors with additional Adjustment Layers. Here is my final result below:

Custom Pearl Necklace With the Mixer Brush Tool

Want to see this in action? Check out the quick video above to see this lesson at work!

A Bit More Detail

Learn more photo effects from our experts! Check out the following tutorials below:

60 Seconds?!

This is part of a series of quick video tutorials on
Envato Tuts+ in which we introduce a range of subjects, all in 60
seconds—just enough to whet your appetite. Let us know in the comments
what you thought of this video and what else you’d like to see explained
in 60 seconds!

View Tutorial: Photoshop in 60 Seconds: Create a Pearl Necklace With the Mixer Brush in Photoshop

Crafty Beyond the Basics: Sounds and Scenes

Just like images or sprites, sound also plays a vital role in games. The right background music can set the mood for the game. Similarly, including sound effects for things like a crash or gunfire will make the game much more interesting.

You can also add scenes to your game to make it more organised. For example, instead of directly showing the game screen to users, you can first show them the home screen where they can choose a difficulty level for the game or increase/decrease the volume of background music. 

In this tutorial, you will learn how to add sounds and scenes to your games using Crafty.

Adding Sounds

The process for adding sounds to a game is similar to adding sprite sheets. You need to create an asset object and then supply an array of audio files for different sound effects. Crafty will then load the first file that is supported by the browser. Here is an example:

var game_assets = {
  "audio": {
    "back_music": ["back_music.wav", "back_music.ogg", "back_music.mp3"],
    "gun_shot": ["gun_shot.wav", "gun_shot.ogg", "gun_shot.mp3"]
  }
};

Crafty.load(game_assets);

Once you have added the audio files, you can play them using Crafty.audio.play(String id, Number repeatCount, Number volume). The first parameter is the Id of the file we want to play. To play the background music, you can pass "back_music" as Id

You can control how many times an audio file is played using the second parameter. When this parameter is not specified, the file is played only once. You would probably want to continuously keep playing some sounds. One such example is the background music of a game. This can be achieved by setting the second parameter to -1. 

The third parameter controls the volume of the given audio file. It can have any value between 0.0 and 1.0. This is the code to play background music:

Crafty.audio.play("back_music", -1, 0.5);

You can also play audio files based on some events like collision between entities or a key press.

walking_hero.bind('KeyDown', function(evt) {
  if (evt.key == Crafty.keys.UP_ARROW) {
    walking_hero.animate("jumping", 1);
    Crafty.audio.play("gun_shot", 1);
  }
});

Keep in mind that you need to add the Keyboard component to your hero before it can detect the KeyDown event. The above code binds the KeyDown event to the hero and checks if the key was pressed using evt.key. If the Up Arrow key is pressed, a jumping animation is played for the hero once. A gunshot sound is played as well.

Try pressing the Up Arrow key in the following demo and you will see it all in action. I have commented out the line that plays the background music, but you can just uncomment it while playing with the demo. 

The background music in the demo has been created by Rosalila, and the gunshot sound is by Luke.RUSTLTD.

There are a lot of other methods that you can use to manipulate the sounds played by Crafty. You can mute and unmute all the audio files that are being played in the game by using .mute() and .unmute() respectively. You can also pause and resume audio files based on their Id by using the .pause(Id) and .unpause(Id) method.

There is a limit on the maximum number of sounds that can be played simultaneously in Crafty. The default limit for this value is 7. Each of the different sounds playing simultaneously is a channel. However, you can set your own value by using Crafty.audio.setChannels(Number n). You can also check if a given audio file is currently playing on at least one channel using the .isPlaying(string ID) method. It will return a Boolean indicating if the audio is playing or not.

Scenes in Crafty

The game screen is generally not the first thing that you see in a game. Usually, the first screen that you see is the loading screen or the main menu screen. Then, once you have set different options like audio or difficulty level, you can click the play button to move on to the actual game screen. Finally, when the game is over, you can show users a game over screen.

These different game screens or scenes make your game more organized. A scene in Crafty can be created by calling Crafty.defineScene(String sceneName, Function init[, Function uninit])

The first parameter is the name of the scene. The second parameter is the initialization function, which sets things up when the scene is played. The third parameter is an optional function which is executed before the next scene is played and after all the entities with 2D component in the current scene have been destroyed.

Here is the code for defining the loading screen:

Crafty.defineScene("loading_screen", function() {
    
  Crafty.background("orange");
  
  var loadingText = Crafty.e("2D, Canvas, Text, Keyboard")
    .attr({ x: 140, y: 120 })
    .text("Scenes Demo")
    .textFont({ size: '50px', weight: 'bold' })
    .textColor("white");

  loadingText.bind('KeyDown', function(evt) {
    Crafty.enterScene("game_screen");
  });
});

In the above code, I have defined a "loading_screen" scene. The initialization function set the background color to orange and shows some text to give the user some information about what’s coming next. You can include a logo and some menu options in an actual game here. Pressing any key while the canvas is in focus will take you to the actual game screen. The .enterScene(String sceneName) method has been used here to load the "game_screen"

In the following demo, you can press the UP key 10 times to go to the final screen.

Conclusion

After completing this tutorial, you should be able to add a variety of sound effects to your game and be able to control the audio output. You can now also show different screens to a user in different situations. I should remind you that I have used Crafty version 0.7.1 in this tutorial, and the demos might not work with other versions of the library. 

In the next and final tutorial of this series, you will learn how to improve collision detection in Crafty.

View Tutorial: Crafty Beyond the Basics: Sounds and Scenes

Making of Robot Earth 3009 Typographic Illustration

What You’ll Be CreatingThis tutorial was originally published in October 2009 as a Tuts+ Premium tutorial. It is now available free to view. Although this tutorial does not use the latest version of Adobe Illustrator, its techniques and process are sti…

View Tutorial: Making of Robot Earth 3009 Typographic Illustration

40 Best Social Media Banner Templates

In today’s world, success is measured by how many followers you have on
social media. So check out this incredible collection of premium social media banners to step up your game and improve your online presence today.

40 Social Media Banners

Need a new banner for your YouTube, Facebook, or Twitter profiles? Impress your followers with exciting profile banners that showcase who you really are to the world.

In this collection of premium assets, we bring you 40 awesome Social Media Banners curated from GraphicRiver and Envato Elements.

Use these designs to jazz up your profiles, or enlist the help of a professional designer by contracting one of the amazing folks from Envato Studio for custom banner designs.

10 Multipurpose YouTube Channel Art

Gain tons of subscribers with this exciting set of multipurpose YouTube channel banners. This set features ten unique styles with four different backgrounds and various color schemes. Download this package today to enjoy a sleek banner design in no time!

10 Multipurpose YouTube Channel Art

Gaming YouTube Channel Banner

If you’re a gamer then you’ll definitely love this set of YouTube banners. This set features five modern layouts with a fresh new perspective on banner design. Get access to retina-ready designs you can easily edit, as well as free icons and fonts.

Gaming YouTube Channel banner

Stellar Social Media Banner Pack

Create an exciting social media experience with this stellar banner pack. This pack features 12 fully editable banners that have been optimized for Facebook, Twitter, Instagram, and more. With over 100 stock photos included, you’ll be able to create exceptional imagery to keep your audience entertained.

Stellar Social Media Banner Pack

Business Twitter Header

Show the world you mean business with this professional Twitter header. This design features a sleek and sophisticated aesthetic, with room to enter all your pertinent contact information. Get the best results for your campaign by downloading this banner today!

Business Twitter Header

Gaming Channel YouTube Banner

Build a successful gaming channel with this awesome YouTube banner. This banner features a sleek and sophisticated design with four different color options to choose from. This file also comes complete with a fully layered Photoshop file and access to resizable vectors.

Gaming Channel Youtube Banner

10 Premium YouTube Banners

Kick start your brand with one of these amazing premium YouTube banners. This package features incredible high-resolution designs in a variety of fun layouts. Download this set to get access to ten total designs along with free updates and fonts.

10 Premium Youtube Banners

Facebook + Instagram Banners Pack

Create a cohesive look across several social media profiles with this Facebook and Instagram combo pack. This pack features ten gorgeous styles that work easily with Smart Objects for further customization. Simply insert your photos into these banners for instant results!

Facebook  Instagram Banners Pack

Instagram Banners Bundle

Instagram is all about great imagery. And you can create stunning banner designs with this huge bundle of 120 Instagram banners. This pack features exceptionally creative templates that are the perfect post size and super easy to edit. Download this pack to start your Instagram marketing campaign today!

Instagram Banners Bundle

10 Multipurpose YouTube Channel Banners

If you’re not sure what kind of YouTube channel you’d like to create, then download this awesome pack of multipurpose YouTube banners. This set features ten elegant designs with completely different layouts, and access to free badges and fonts.

10 Multipurpose YouTube Channel Banners

Political Election Social Media Banner

Get political with this professional social media template. This banner features five easily editable designs and a clean, modern layout that is sure to impress voters. Simply insert your favorite politician to take advantage of this awesome design today!

Political Election Social Media Banner

Multipurpose Facebook Banners

Multipurpose banners save you the hassle of creating designs specific to a certain genre. And with this incredible set, you’ll get access to ten quality banner designs featuring awesome aesthetics and vibrant colors. Simply change the photos with some of your own to customize these designs instantly.

Multipurpose Facebook Banners

Facebook Timeline Texture Covers

Add a little texture to your timeline with this wicked set of Facebook covers. Designed to mimic a cool grunge effect, this set features 11 different Facebook covers with a variety of layout options. And with fully editable elements, you can change any banner, ribbon, or logo quickly and easily.

Facebook Timeline Texture Covers

Facebook Timeline Covers

Make your Facebook stand out with this impressive collection of timeline covers. This pack features ten modern designs that focus on unique ways to display photo collages. Included in this file are ten fully layered Photoshop files and an additional help file for your convenience.

Facebook Timeline Covers

Collage Timeline Facebook Cover

Feature an exciting collage for your Facebook cover today! This package includes two uniquely designed Photoshop files with Smart Objects you can easily interchange to fit the photos you need into your collage. Download this cover today to show off a collection of your best photos!

Collage Timeline Facebook Cover

Twitter Background Design

Upload an epic Twitter banner that matches your thoughtful tweets. This fresh design features a clean layout with room to post your favorite photos from all your adventures. Download this file today to get access to the third best selling Twitter background on GraphicRiver.

Twitter Background Design

Facebook Timeline Cover Two

Create a color that matches the famous Facebook layout. This cool timeline features a sleek, modern design with angular elements you can easily adjust. Customize this cover with a few of your favorite photos to add personality to your timeline.

Facebook Timeline Cover Two

Multipurpose YouTube Banner

If you’re looking for a banner design that can be used across several channels then check out this awesome YouTube banner. This package features a fully editable Photoshop file that comes with three different color variations to choose from.

Multipurpose YouTube Banner

Gym & Fitness Facebook Timeline Cover

Brand your new fitness business with these vibrant Facebook timeline covers. These covers feature a clean, minimalist design with three different colors to choose from. Insert your own model photo to customize this cover even further or find a great alternative on Envato Market through PhotoDune.

Gym  Fitness Facebook Timeline Cover

Modern Facebook Banners

Nothing beats the fresh, clean look of modern design. This incredible set features four Photoshop files with unique minimalist designs you can use to show off all your interests. Impress your audience with these professional, high-quality banner designs.

Modern Facebook Banners

Designer Twitter Banner

Show off your love of design with this fun Twitter banner. This banner features a collage-inspired design that allows you to showcase your favorite work. Simply post your art or photos into the customizable Smart Objects to enjoy this banner in as little as a few minutes.

Designer Twitter Banner

YouTube Creative Cover V.1

Show off your style with these exciting YouTube banner designs. This pack features six creative layouts you can use for nearly any genre. With high-resolution covers at 300 dpi and access to free fonts, you’ll be happy you downloaded this pack.

Youtube Creative Cover V1

Social Media Banners – Vol2

Create gorgeous Instagram visuals that are sure to stop anyone in their tracks with this set of social media banners. This set features five promo banners adjusted to fit Instagram’s post dimensions as well as fully layered, trendy designs.

Social Media Banners - Vol2

Gym Facebook Cover

Get ready to train hard with this tough Facebook timeline cover. This cover features a sleek design that can be easily combined with any photo of your choice. Simply add your favorite athletic stock to take advantage of this fierce cover.

Gym Facebook Cover

Dortoretto Restaurant – Facebook Rustic Cover

Take charge of your marketing campaign with this exciting rustic Facebook cover. This cover features a delicious, restaurant-inspired design that is perfect for any local pizzeria. Download this package to get access to three different layouts available in high resolution.

Dortoretto Restaurant  Facebook Rustic Cover

Facebook Social Media Banners Pack

Get an endless supply of social media banners to make your timelines pop! This massive set includes 250 Facebook post images you can use to show off your blog, fashion, or design interests. With fully customizable files, this pack lets you simply insert the quotes or text you need to make these images your own.

Facebook Social Media Banners Pack

Twitter Social Media Banners Pack

Add fresh, modern imagery to your Twitter profile with this massive banner pack. This pack features 250 Twitter post images you can use to highlight your passions. Great for beginners, this pack includes an HD video tutorial for additional help.

Twitter Social Media Banners Pack

80 Banners – Stories Edition

The more beautiful the images you post on social media, the more likely you’ll be able to reach your audience. And with this incredibly stylish social media pack, you’ll get 80 gorgeous banners you can use for your profiles, blogs, or websites.

80 Banners - Stories Edition

Dj / Music Facebook Cover

Your Facebook cover should be as extraordinary as you are. This cover features a DJ-inspired design with fun geometric shapes to add a sense of stylish, modern design. A clean and elegant template, this design is perfect for a wide range of creative professions.

Dj  Music Facebook Cover

10-Facebook Post Banners-DJ Event

Kick off your next event in style with these awesome Facebook post banners. These banners feature a music-inspired design with vibrant colors in ten different styles. Customize these banners even further with your favorite DJ stock from PhotoDune.

10-Facebook Post banners-DJ Event

Stylized Christmas Banners

Celebrate the holidays with this festive set of Christmas banners. This set includes five vector files with fully editable layers to adjust your vector elements. Super easy to use, this banner set is print ready and can be used across all your social media accounts.

Stylized Christmas banners

Dortoretto Twitter Backgrounds Circle

Create a stunning background for your Twitter profile with this awesome banner set. This set features three restaurant-inspired designs perfect for your catering or food-related business. Enjoy unique designs featuring circular elements for a classy, modern aesthetic.

Dortoretto Twitter Backgrounds Circle

Aibe – Social Media Mega Pack

Take your social media game to a whole new level with these amazing multi-purpose banner designs. This set features 100 incredible templates you can use for Facebook, Twitter, Instagram, and so much more!

Aibe - Social Media Mega Pack

Pinterest Social Media Banners Pack

Do you love Pinterest? Then you’ll definitely love to add this pack of social media banners to your favorite pins. This pack features 250 pin images with a social media cheat sheet to help you master your online presence today.

Pinterest Social Media Banners Pack

Instagram Promotional Banners

Sell and advertise your products effectively with this professional set of e-commerce banners. Designed specifically for posting on Instagram, this set of 20 designs includes fully editable elements you can customize with ease.

Instagram Promotional Banners

10 Instagram Post Banner – Coffee Shop

Bring the world to your local coffee shop with these premium banner designs. This package features ten gorgeous Instagram banners with a sultry coffee theme that is sure to warm your heart. And since all the vector objects are resizable, you won’t have any loss of image quality.

10 Instagram Post Banner - Coffee Shop

30 Twitter Covers – Food & Restaurant

No matter what kind of business you have, a strong social media presence is incredibly important. Get the most out of your online profiles with this pack of 30 different Twitter banners. This set features an exciting collection of food-related banners perfect for engaging new customers.

30 Twitter Covers - Food  Restaurant

ChefBistro Social Media Banner

Create engaging banners that are sure to make your audience salivate! With this social media banner set, enjoy clean, professional designs catered to any food-related business. Included are both Photoshop and vector files for your convenience.

ChefBistro Social Media Banner

Social Media Booster Kit

Improve your presence online with this essential social media booster kit. This kit features 15 creative social media templates you can use for Facebook, Instagram, and more. Use these designs to create engaging content we’re sure you’ll audience will love!

Social Media Booster Kit

Creative Facebook Cover

Show off your unique style with this creative Facebook cover. This cover features a unique circular design that allows you to add more personality to your profile. This is a multipurpose template that’s great for many projects, so download this design to get started with it right away!

Creative Facebook Cover

Alium – Social Media Pack

Upload stunning imagery to your social media accounts with this awesome banner pack. This pack features 25 multipurpose creative templates you can use for Facebook, Instagram, and so much more. Included are square, horizontal, and vertical formats to fit any profile’s dimension.

ALIUM - Social Media Pack

Conclusion

This list is jam-packed with social media resources for the
avid designer familiar with Adobe Photoshop and Illustrator. But with thousands of social media banners available at your fingertips, chances are we’ve missed a few to add to your
personal collection. 

Be sure to browse GraphicRiver and Envato Elements for more resources and let us know your favorites in the comments below! Or if you need a more hands-on approach, consider enlisting the help of a design professional from Envato Studio.

View Tutorial: 40 Best Social Media Banner Templates

Create a Fantasy Photo Manipulation of Valkyrie

Learn how to do this fantasy photo manipulation with mythological goddess – Valkyrie. You will learn, how to create dark themed background by using only two stock photos, how to add dramatic effects with particles and how to make depth of field in your work. Sounds interesting? Check it out! What you’ll be creating Valkyrie […]

The post Create a Fantasy Photo Manipulation of Valkyrie appeared first on Photoshop Tutorials.

View Tutorial: Create a Fantasy Photo Manipulation of Valkyrie

Swift From Scratch: Function Parameters, Types, and Nesting

In the previous article, we explored the basics of functions in Swift. Functions, however, have a lot more to offer. In this article, we continue our exploration of functions and look into function parameters, nesting, and types.

1. Local and External Parameter Names

Parameter Names

Let us revisit one of the examples from the previous article. The printMessage(message:) function defines one parameter, message.

func printMessage(message: String) {
    print(message)
}

We assign a name, message, to the parameter and use this name when we call the function.

printMessage(message: "Hello, world!")

But notice that we also use the same name to reference the value of the parameter in the body of the function.

func printMessage(message: String) {
    print(message)
}

In Swift, a parameter always has a local parameter name, and it optionally has an external parameter name. In the example, the local and external parameter names are identical.

API Guidelines

As of Swift 3, the Swift team has defined a clear set of API guidelines. I won’t go into those guidelines in this tutorial, but I want to point out that the definition of the printMessage(message:) function deviates from those guidelines. The name of the function contains the word message, and the parameter is also named message. In other words, we are repeating ourselves.

It would be more elegant if we could invoke the printMessage(message:) function without the message keyword. This is what I have in mind.

printMessage("Hello, world!")

This is possible, and it is more in line with the Swift API guidelines. But what is different? The difference is easy to spot if we take a look at the updated function definition. The updated example also reveals more about the anatomy of functions in Swift.

func printMessage(_ message: String) {
    print(message)
}

In a function definition, each parameter is defined by an external parameter name, a local parameter name, a colon, and the type of the parameter. If the local and external parameter names are identical, we only write the parameter name once. That is why the first example defines one parameter name, message.

If we don’t want to assign an external parameter name to a parameter, we use the _, an underscore. This informs the compiler that the parameter doesn’t have an external parameter name, and that means we can omit the parameter name when the function is invoked.

External Parameter Names

Objective-C is known for its long method names. While this may look clunky and inelegant to outsiders, it makes methods easy to understand and, if chosen well, very descriptive. The Swift team understood this advantage and introduced external parameter names from day one.

When a function accepts several parameters, it isn’t always obvious which argument corresponds to which parameter. Take a look at the following example to better understand the problem. Notice that the parameters don’t have an external parameter name.

func power(_ a: Int, _ b: Int) -> Int {
    var result = a

    for _ in 1..<b {
        result = result * a
    }

    return result
}

The power(_:_:) function raises the value of a by the exponent b. Both parameters are of type Int. While most people will intuitively pass the base value as the first argument and the exponent as the second argument, this isn’t clear from the function’s type, name, or signature. As we saw in the previous article, invoking the function is straightforward.

power(2, 3)

To avoid confusion, we can give the parameters of a function external names. We can then use these external names when the function is called to unambiguously indicate which argument corresponds to which parameter. Take a look at the updated example below.

func power(base a: Int, exponent b: Int) -> Int {
    var result = a

    for _ in 1..<b {
        result = result * a
    }

    return result
}

Note that the function’s body hasn’t changed since the local names haven’t changed. However, when we invoke the updated function, the difference is clear and the result is less confusing.

power(base: 2, exponent: 3)

While the types of both functions are identical, (Int, Int) -> Int, the functions are different. In other words, the second function isn’t a redeclaration of the first function. The syntax to invoke the second function may remind you of Objective-C. Not only are the arguments clearly described, but the combination of function and parameter names also describe the purpose of the function.

In some cases, you want to use the same name for the local and the external parameter name. This is possible, and there’s no need to type the parameter name twice. In the following example, we use base and exponent as the local and external parameter names.

func power(base: Int, exponent: Int) -> Int {
    var result = base

    for _ in 1..<exponent {
        result = result * base
    }

    return result
}

By defining one name for each parameter, the parameter name serves as the local and external name of the parameter. This also means that we need to update the body of the function.

It’s important to note that by providing an external name for a parameter, you are required to use that name when invoking the function. This brings us to default values.

Default Values

We covered default parameter values in the previous article. This is the function we defined in that article.

func printDate(date: Date, format: String = "YY/MM/dd") -> String {
    let dateFormatter = DateFormatter()
    dateFormatter.dateFormat = format
    return dateFormatter.string(from: date)
}

What happens if we don’t define an external parameter name for the second parameter, which has a default value?

func printDate(date: Date, _ format: String = "YY/MM/dd") -> String {
    let dateFormatter = DateFormatter()
    dateFormatter.dateFormat = format
    return dateFormatter.string(from: date)
}

The compiler doesn’t seem to care. But is this what we want? It is best to define an external parameter name to optional parameters (parameters with a default value) to avoid confusion and ambiguity.

Notice that we are repeating ourselves again in the previous example. There is no need to define an external parameter name for the date parameter. The next example shows what the printDate(_:format:) function would look like if we followed the Swift API guidelines.

func printDate(_ date: Date, format: String = "YY/MM/dd") -> String {
    let dateFormatter = DateFormatter()
    dateFormatter.dateFormat = format
    return dateFormatter.string(from: date)
}

We can now invoke the formatDate(_:format:) function without using the date label for the first parameter and with an optional date format.

printDate(Date())
printDate(Date(), format: "dd/MM/YY")

2. Parameters and Mutability

Let us revisit the first example of this tutorial, the printMessage(_:) function. What happens if we change the value of the message parameter inside the function’s body?

func printMessage(_ message: String) {
    message = "Print: \(message)"
    print(message)
}

It doesn’t take long for the compiler to start complaining.

Parameters and Mutability

The parameters of a function are constants. In other words, while we can access the values of function parameters, we cannot change their value. To work around this limitation, we declare a variable in the function’s body and use that variable instead.

func printMessage(_ message: String) {
    var message = message
    message = "Print: \(message)"
    print(message)
}

3. Variadic Parameters

While the term may sound odd at first, variadic parameters are common in programming. A variadic parameter is a parameter that accepts zero or more values. The values need to be of the same type. Using variadic parameters in Swift is trivial, as the following example illustrates.

func sum(_ args: Int...) -> Int {
    var result = 0

    for a in args {
        result += a
    }

    return result
}

sum(1, 2, 3, 4)

The syntax is easy to understand. To mark a parameter as variadic, you append three dots to the parameter’s type. In the function body, the variadic parameter is accessible as an array. In the above example, args is an array of Int values.

Because Swift needs to know which arguments correspond to which parameters, a variadic parameter is required to be the last parameter. It also implies that a function can have at most one variadic parameter.

The above also applies if a function has parameters with default values. The variadic parameter should always be the last parameter.

4. In-Out Parameters

Earlier in this tutorial, you learned that the parameters of a function are constants. If you want to pass a value into a function, modify it in the function, and pass it back out of the function, in-out parameters are what you need.

The following example shows an example of how in-out parameters work in Swift and what the syntax looks like.

func prefixString(_ string: inout String, with prefix: String) {
    string = prefix + string
}

We define the first parameter as an in-out parameter by adding the inout keyword. The second parameter is a regular parameter with an external name of withString and a local name of prefix. How do we invoke this function?

var input = "world!"

prefixString(&input, with: "Hello, ")

We declare a variable, input, of type String and pass it to the prefixString(_:with:) function. The second parameter is a string literal. By invoking the function, the value of the input variable becomes Hello, world!. Note that the first argument is prefixed with an ampersand, &, to indicate that it is an in-out parameter.

It goes without saying that constants and literals cannot be passed in as in-out parameters. The compiler throws an error when you do as illustrated in the following examples.

In-Out Parameters

It’s evident that in-out parameters cannot have default values or be variadic. If you forget these details, the compiler kindly reminds you with an error.

5. Nesting

In C and Objective-C, functions and methods cannot be nested. In Swift, however, nested functions are quite common. The functions we saw in this and the previous article are examples of global functions—they are defined in the global scope.

When we define a function inside a global function, we refer to that function as a nested function. A nested function has access to the values defined in its enclosing function. Take a look at the following example to better understand this.

func printMessage(_ message: String) {
    let a = "hello world"

    func printHelloWorld() {
        print(a)
    }
}

While the functions in this example aren’t terribly useful, they illustrate the idea of nested functions and capturing values. The printHelloWorld() function is only accessible from within the printMessage(_:) function.

As illustrated in the example, the printHelloWorld() function has access to the constant a. The value is captured by the nested function and is therefore accessible from within that function. Swift takes care of capturing values, including managing the memory of those values.

6. Function Types

Functions as Parameters

In the previous article, we briefly touched upon function types. A function has a particular type, composed of the function’s parameter types and its return type. The printMessage(_:) function, for example, is of type (String) -> (). Remember that () symbolizes Void, which is equivalent to an empty tuple.

Because every function has a type, it’s possible to define a function that accepts another function as a parameter. The following example shows how this works.

func printMessage(_ message: String) {
    print(message)
}

func printMessage(_ message: String, with function: (String) -> ()) {
    function(message)
}

let myMessage = "Hello, world!"

printMessage(myMessage, with: printMessage)

The printMessage(_:with:) function accepts a string as its first parameter and a function of type (String) -> () as its second parameter. In the function’s body, the function that we pass in is invoked with the message argument.

The example also illustrates how we can invoke the printMessage(_:with:) function. The myMessage constant is passed in as the first argument and the printMessage(_:) function as the second argument. How cool is that?

Functions as Return Types

It is also possible to return a function from a function. The next example is a bit contrived, but it illustrates what the syntax looks like.

func compute(_ addition: Bool) -> (Int, Int) -> Int {
    func add(_ a: Int, _ b: Int) -> Int {
        return a + b
    }

    func subtract(_ a: Int, _ b: Int) -> Int {
        return a - b
    }

    if addition {
        return add
    } else {
        return subtract
    }
}

let computeFunction = compute(true)
let result = computeFunction(1, 2)
print(result)

The compute(_:) function accepts a boolean and returns a function of type (Int, Int) -> Int. The compute(_:) function contains two nested functions that are also of type (Int, Int) -> Int, add(_:_:) and subtract(_:_:).

The compute(_:) function returns a reference to either the add(_:_:) or the subtract(_:_:) function, based on the value of the addition parameter.

The example also shows how to use the compute(_:) function. We store a reference to the function that is returned by the compute(_:) function in the computeFunction constant. We then invoke the function stored in computeFunction, passing in 1 and 2, store the result in the result constant, and print the value of result in the standard output. The example may look complex, but it is actually easy to understand if you know what is going on.

Conclusion

You should now have a good understanding of how functions work in Swift and what you can do with them. Functions are fundamental to the Swift language, and you will use them extensively when working with Swift.

In the next article, we dive head first into closures—a powerful construct reminiscent of blocks in C and Objective-C, closures in JavaScript, and lambdas in Ruby.

If you want to learn how to use Swift 3 to code real-world apps, check out our course Create iOS Apps With Swift 3. Whether you’re new to iOS app development or are looking to make the switch from Objective-C, this course will get you started with Swift for app development. 

 

View Tutorial: Swift From Scratch: Function Parameters, Types, and Nesting

How to Design a Virtual Reality Kid Character in Affinity Designer

Final product image
What You’ll Be Creating

In this tutorial, we’ll go all the way through the exciting process of designing a cartoon character from scratch to the finished piece! Join me and let’s see how we can enliven our rough sketch by transforming geometric shapes, applying gradients and using various tools and functions of the Draw Persona of Affinity Designer to make the process fun and easy! Let’s start!

By the end of this tutorial, you’ll create a fancy character in a dynamic pose and will be able to use these techniques and create unique vector characters from your sketches! If you need some inspiration for your future projects, head straight to GraphicRiver and discover the variety of vector characters available there!

1. How to Draw the Kid’s Head and Nose

Step 1

First of all, we need a sketch. It can be a rough doodle scribbled on a piece of paper or a digital piece created in any CG software using a graphics tablet.

Here’s a sketch of a boy I’ve made beforehand. You can create your own or just download this one by clicking it with the right mouse button and choosing Save As.

character sketch

Step 2

Create a New Document of 800 x 600 px size and use the Place Image Tool to import your sketch and embed it in the canvas.

Select the sketch in the Layers panel and decrease its Opacity to 50%. Set the Blend Mode to Multiply, making the image semi-transparent. This way we’ll be able to see all the elements that we’ll be creating beneath the sketch.

Create a New Document and place the sketch

Step 3

Create a New Layer and drag it beneath the sketch layer.

Let’s start creating the head. Use the Ellipse Tool (M) to make a 130 x 120 px shape. Click the Convert to Curves button in the control toolbar on top in order to be able to modify the shape.

Select the left node using the Node Tool (A) and drag the node down, combining it with the extreme point of the boy’s cheek on the sketch.

Pull the node handle up, making the oval fit the lines of the sketch.

make the head from the ellipse

Step 4

Let’s apply the gradient fill to our shape in order to add some volume to it. Select the shape, take the Fill Tool (G), and click and drag across the shape. Now we can edit the colors: either by selecting the circle sliders of the gradient fill and adjusting their colors in the Colour panel, or by playing with the settings of the Fill options window in the control toolbar on top. Open the Gradient Fill panel and click the sliders of the gradient bar to adjust the colors.

Make the bottom of the face slightly darker than the forehead.

apply a linear gradient fill

Step 5

Use the Ellipse Tool (M) to make an ear. Apply a Linear Fill to it, making the tip of the ear pink. Convert to Curves and deform the ear slightly, making it fit the sketch.

make the ear from the ellipse

Step 6

Let’s add details to the ear using the Pencil Tool (N). Make an arched stroke and set the Stroke color to brown in the Colour panel. Adjust the settings either from the control toolbar on top or from the Stroke panel, setting the Width value to 5 pt and the Controller to Pressure.

We can move the nodes of the stroke using the Node Tool (A) in order to make the line smooth.

Add another, shorter stroke, attaching it to the first one.

add details to the ear using the Pencil Tool N

Step 7

This is how the head base looks if we toggle the visibility of the sketch layer.

the head base

Step 8

Now let’s draw a nose. Use the Pencil Tool (N) to make a funny arched drop-like shape. You can also use the Pen Tool (P) instead, which gives you more control over the nodes.

 Use the Pencil Tool N to draw the nose

Step 9

Fill the nose with a diagonal linear gradient from red to pink. Add a smaller drop-like shape on the tip of the nose and apply a lighter gradient to make a shiny highlight.

Fill the nose with a diagonal linear gradient

Step 10

Make the sketch invisible and make sure that all the details and color fit each other properly.

Make the sketch invisible

2. How to Draw a Virtual Reality Headset

Step 1

Use the Rounded Rectangle Tool (M) to make a 95 x 45 px shape filled with a dark gray linear gradient. We can adjust the Corner radius from the control toolbar on top before we Convert the shape to Curves (in order to make it editable).

Once the shape is converted, use the Node Tool (A) to add nodes and move the node handles, making the shape fit the perspective and combining the edges to the outlines of the sketch. Create a small arc at the nose-bridge area of the VR and place the boy’s nose on top of the VR by selecting it and pressing Shift-Control-].

make a virtual reality set from rectangle

Step 2

Now let’s add a glowing blue element on top of the VR headset. Use the Rounded Rectangle Tool (M) to make a 30 x 10 px shape and rotate it -15 degrees. Open the Effects panel (you can find it next to the Layers panel) and tick the Outer Glow checkbox. From here we can adjust the color of the glow and other parameters of this effect.

Convert the shape to Curves and make its right part slightly narrower to make it fit the perspective.

add a glowing blue element

Step 3

Let’s add details to the headset. Select it and click the Insert inside the selection button in the Insert Target panel. You can find it in the upper right corner of the control toolbar on top.

Now we can use either the geometric shapes or the drawing tools (the Pencil Tool (N) or the Pen Tool (P)) to add two rectangular stripes at the bottom and the top of the VR set.

Fill the top stripe with lighter gray color and the bottom one with darker gray color, making the headset more three-dimensional.

use the Insert inside the selection function

Step 4

Continue using one of the drawing tools to depict the mouth by tracing the shape of the sketch. Fill it with white color for the teeth and add darker strokes on top, depicting the wrinkles of the skin.

Adjust the Width of the strokes, setting the parameter to 5.5 pt.

draw a mouth and adjust the strokes

Step 5

Let’s go back to the VR set and create its side element. Use the Rectangle Tool (M) to create a 20 x 40 px gray shape and Convert to Curves. Rearrange the objects, placing the rectangle beneath the VR set. Move the anchor points of the rectangle, making its right side wider.

Duplicate (Command-J) the rectangle and let’s turn it into a strap. First of all, let’s change the fill color. Copy (Command-C) the dark gray VR shape, and then select the rectangle and Edit > Paste Style, this way applying the dark gray gradient fill to the shape.

Now we can select and drag the top and bottom left nodes of the rectangle to the opposite side, turning the shape “inside out”.

make the side strap of the VR

Step 6

Stretch the strap behind the ear. Place the ear and its elements on top of the strap (Shift-Command-]).

make the stretch longer

Step 7

Let’s move on and create a hairdo. Draw out the silhouette, using our sketch as a guide, and apply a linear fill from red to brown. Use the Insert inside the selection function to draw some dark-brown lines inside the hair shape, depicting separate locks.

draw the hair

Step 8

Finish off the boy’s face by speckling some freckles on his cheeks. Use the Ellipse Tool (M) while holding down Shift to make the circles even.

Create a rectangle of about 15 x 20 px size for the neck. Apply a linear fill, making the top of the shape slightly darker than the face. Convert it to Curves and move the nodes, making its bottom part narrower.

make circle freckles

3. How to Draw the Body in Dynamic Pose

Step 1

Take the Rectangle Tool (M) and let’s start designing the t-shirt! Make a 60 x 115 px rectangle and apply a bright-purple linear fill, darkening the bottom of the shape.

Convert to Curves, take the Node Tool (A), and let’s drag the nodes in opposite directions, sticking them to the shoulders and to the bottom edges of the t-shirt in our sketch.

Click and drag the side of the rectangle in order to bend its edge, making it fit the sketch.

Make the left, right and bottom edges of the rectangle arched so that it looks more cartoonish.

Create an additional node in the middle of the top edge and drag it up, to the neck of the character.

make a t-shirt from rectangle

Step 2

Now we’ll add the sleeves. Create a rectangle on the left side of the body and apply the same purple linear fill.

Convert to Curves and move the nodes, attaching the sleeve to the t-shirt.

make a sleeve from the rectangle

Step 3

We can turn on the Snapping function to make it easier to combine the nodes. This way we can align the nodes and see at what point they overlap.

turn on the snapping

Step 4

Add the second sleeve, making all the elements fit each other.

Add the second sleeve

Step 5

Let’s draw the arms. Use the Pencil Tool (N) (or the Pen Tool (P)) to make an arched stroke.

Open the Stroke panel (or the Stroke menu in the control panel on top) and set the Width to 14 pt, making the line thick enough. Set the Cap to Round Cap.

Open the Pressure settings and adjust the graph to make the arm thicker at the shoulder and thinner at the wrist by moving the points of the graph as shown in the image below.

make the arm from a thick stroke

Step 6

Now we’ll create a hand from a circle. Use the Ellipse Tool (L) to make a 22 x 21 px shape. Convert it to Curves and start modifying the shape, forming a palm. Hold down the Option key and use the Node Tool (A) in order to pull and move the handles of the node independently from each other.

Use the Pencil Tool (N) to draw a thumb. Make its gradient fill slightly lighter (especially at the top of the thumb) to separate it from the palm.

create a hand from a circle

Step 7

Use the Rounded Rectangle Tool (M) to create the fingers. Rotate them slightly and vary the length of each finger.

Use the Rounded Rectangle Tool M to create the fingers

Step 8

Let’s depict the motion controller in the boy’s hand. Start by making a 30 x 30 px pink circle using the Ellipse Tool (M).

Switch to the Rectangle Tool (M) and make a 45 x 12 px shape with the same dark gray linear fill as we have for the VR set.

Convert to Curves and reshape the rectangle, making a cylinder grip. Rearrange the object, placing the grip between the fingers and the palm in the Layers panel.

depict the motion controller

Step 9

Duplicate (Control-J) the arm and use the Transforms function in the control panel on top to Flip Horizontal. Modify the copy to create the second arm and hand, holding the blue motion controller.

reate the second arm

Step 10

Let’s add the neckpiece to the t-shirt using the Insert Target function. Select the t-shirt and click the Insert inside the selection button. Use the Ellipse Tool (M) or the Pencil Tool (N) to make a small oval and fill it with skin color, making it match the neck of the character.

use the Insert Target function

Step 11

Now we’re moving on to the legs! Use the Rectangle Tool (M) to make a 30 x 155 px grayish-blue shape. Convert to Curves and move the points using the Node Tool (A). Bend the edges of the rectangle, making them fit the lines of the sketch.

make a leg from the rectangle

Step 12

Adjust the leg, making it look more cartoonish and flexible. Apply a linear gradient fill, darkening the bottom of the jeans.

Apply a linear gradient fill

Step 13

Draw the second leg, following the lines of the sketch and, once you’re happy with its form, select both legs and apply the Add Operation from the control panel on top to merge both objects together.

Use the Insert inside the selection function to draw a rectangular hole on the left knee of our character.

Draw the second leg and add a hole

4. How to Draw the Gumshoes

Step 1

Now that the legs are ready, let’s move on and depict those gumshoes. Start by forming a sole from a 70 x 8 px light gray rectangle. Make a thinner and darker line across the sole.

Create another 70 x 8 px rectangle on top of the first one and fill it with dark gray color. Convert to Curves, take the Node Tool (A), add a node on the top edge, and drag it up.

make a gumshoe from rectangles

Step 2

Let’s form the toecap of the gumshoe. Duplicate (Command-J) the sole and make the rectangle shorter. Convert to Curves and bend its top edge up, making a large arch. Delete the bottom nodes or move them up, positioning the toecap in its place.

form the toecap from the rectangle

Step 3

Use the Insert inside the selection function to draw a few arched notches inside the toecap. Add two loops for the shoestrings.

Duplicate (Command-J) and Flip Horizontal to create the opposite shoe.

Add two loops for the shoestrings

Step 4

Let’s add some more details to the jeans. Continue using the Pencil Tool (N) (or the Pen Tool (P)) to make a dark-blue 1 pt stroke for the pocket.

Make the line Dashed in the Stroke panel, and set the Dash value to 2 and the Gap value to 3, creating a stitch.

Add more strokes and stitches to the jeans, making them look more true to life.

add some more details to the jeans

Step 5

Let’s hide our sketch layer and check out the overall look of our character to see if every part is in the right place. We can add any minor details to our liking. For example, here I’ve added a flat target symbol to the boy’s t-shirt. I’ve also placed a squashed ellipse beneath his feet, so that he stands flat on the ground.

add a target symbol to the t-shirt

5. How to Create a Background With Symbols

Step 1

Now that our character is finished, let’s make the whole composition look balanced by adding minor details to the background.

Create a New Layer and place it beneath all other layers in the Layers panel.

Create a large light-yellow rectangle. Convert it to Curves and move the top nodes in opposite directions, making the top part of the shape wider.

make a yellow rectangle

Step 2

Use various custom shapes of Affinity Designer to fill the background with symbols. You can find all the fancy shapes in the same drop-down menu as the Triangle Tool. Note that every shape has its own settings and adjustments available in the control toolbar on top.

Set the Fill color of the shapes to none and the Stroke color to bright blue. Adjust the Width of the elements in the Stroke panel and make the outlines Dashed.

create custom shapes with dashed strokes

Awesome! Our Cartoon VR Kid Character Is Finished!

You’ve done a great job, my friends, and successfully created your cartoon character in Affinity Designer! 

I hope you’ve enjoyed following this tutorial and learned some new tips and tricks that can help you to understand the principles of working with simple shapes and gradients in order to make the elements look dynamic and diverse. 

Continue designing your own fancy characters and apply these techniques, turning your sketches into finished vector artworks!

Have fun!

Cartoon VR Kid Character is Finished
View Tutorial: How to Design a Virtual Reality Kid Character in Affinity Designer