Lompat ke konten Lompat ke sidebar Lompat ke footer

Widget HTML #1

Animation Game Maker Studio 2

Animation Game Maker Studio 2

GameMaker has support for non-bitmap sprites in the form of vector SWF files or Spine Skeletal Animation files. Both these formats have their pros and cons, and the two sections below explain how to import them into the Sprite Editor as well as a bit of information about how they are drawn.

A sprite made using skeletal animation, is one in which a base skeleton has been created and animated using key-frames to move the component parts of the skeleton over time. This skeleton is then skinned from a texture atlas and the resulting animation exported in one of many file types. GameMaker permits you to import this type of sprite as long as it has been exported as a *.json format file and has the correctly associated texture atlas file (*.atlas) and image file (as a *.png)

GameMaker

Currently GameMaker can only import vector images from JSON format files made by the program Spine, however the way to import them into the program is almost identical to that for adding a normal bitmap image. To add a skeletal animation, you need to create a new sprite, which will bring up the standard Load Sprite dialogue, only here you need to make sure that you have selected *.json from the file filter at the bottom:

How To Bring Characters To Life Using Sequences

Hitting the load button will add the skeletal animation to the Asset Browser as a sprite, with a progress bar being shown as the file is processed. Note that, depending on the complexity of the file, this may take a moment or two. When processing has finished you'll be returned to the sprite properties dialogue, which will now look like this:

Once you have imported the animation, you can set the collision properties, but note that you are limited here to simply using precise collisions or bounding box collisions, and that the collision data for a skeletal animation is explicitly taken from the data provided. GameMaker does not generate any collision mask if the data is missing from imported file, meaning you simply won't get working collisions if the masks are not set correctly in the program used to create the image being imported.

NOTE Due to the complexity of skeletal animations, the preview image shown in the sprite editor is not intended to accurately represent your animation, but rather give you a simple image that represents the animation for visualising in the room editor.

Gamemaker Studio 2: Changing The Gamemaker

Unlike bitmap sprites, the imported skeletal animation sprite cannot be modified in the editor in any way, but there are a number of functions available within the GameMaker Language (GML) which can be used to change skins, set properties, and control other aspects of the animation. You also cannot set any of the texture options for the sprite (except for the texture group), as GameMaker will use the supplied texture atlas that was made by the program that generated the sprite.

There are a number of things that you should be aware of when importing skeleton animation sprites, with the most important being that some of the sprite drawing and sprite management functions are not supported for technical reasons, particularly those draw functions that draw only part of a sprite, or that skew the position in some way (see the individual draw_sprite_*()  functions for exact details of which). However the basic sprite drawing functions are fully supported as are the built in sprite variables. Apart from these functions and variables, you can also set and change animation properties using special skeleton_* functions, which are listed and explained in the reference section on Skeletal Animations.

Generally all sprites in Non-Bitmap Sprites use bitmaps which - while flexible in terms of content - place limitations on both the size and number of frames possible in a sprite before memory usage can become prohibitive. Vector sprites work around these limitations by storing and drawing their contents differently: instead of a grid of pixels, which can become blocky or fuzzy when scaled, they are drawn as triangles using vector maths and these can be scaled up (or down) without losing definition, as illustrated in the image below:

Gamemaker Studio 2. Make A Game With The Complete Game Development Tool

To help you visualise how this is done, the image below is of the same vector Fireman sprite only now we can see the polygons that are used to make the image within GameMaker:

Alpha

However, nothing is ever for free when it comes to programming games, and the trade-off here with vector sprites is that they are more CPU expensive to draw than bitmap sprites and this speed difference increases as the complexity of the animation being imported increases. Also, their memory usage is affected by their visual complexity, unlike bitmap sprites. Bearing that in mind, they do make it possible to add large animated graphics in ways that would be impossible using traditional bitmapped sprites.

On the flipside of the performance equation, because vector sprites only draw the pixels absolutely required (unlike bitmap sprites which also draw the empty space around the image) they can be cheaper from a GPU perspective. Also, in general vector sprites are much smaller than their bitmap equivalents - for the fireman example above the sizes of the various sprite types are as follows:

Be A Game Maker In Gamemaker Studio 2

So, as you can see, a lot of memory can potentially be saved by using vector sprites, and we still have a lot of potential for future space savings.

Support for vector sprites. and can only import vector images from SWF format files. The way of importing them into the program is almost identical to that for adding a normal bitmap image. To add a vector sprite, create a new sprite, which will bring up the standard Load Sprite dialogue, but make sure that you have selected *.swf from the file filter at the bottom.

New

Hitting the load button will add the vector image or animation to the Asset Browser, with a progress bar being shown as the file is processed. Note that, depending on the complexity of the file, this can take a while (up to a minute for more complex animations). When processing has finished you'll be returned to the sprite properties dialogue, which will now look like this:

Platformer Game Kit

The sprite editor won't have changed much, but now the Edit Image button has been greyed out and can't be clicked since there aren't any bitmaps to edit in this sort of sprite. Secondly, all the texture options have been greyed out, except for the texture group.

NOTE How the image looks in your chosen preview editor will not be the same as how it looks in your game, nor how it looks in the preview window of the sprite editor. The vector image will be imported at the size it was created at, which is not necessarily the size that the preview is shown at (browsers will normally scale the image to fit, for example).

Of the vector sprite when drawn using the SWF Precision slider at the top. This will simply reduce or increase the number of triangles used to generate the sprite - with a value of about 50% being sufficient normally for most games - however you should experiment with this value if you are using extreme scaling, or are having performance issues.

A

Animation And Image_index Problem

There are a number of things that you should be aware of when importing vector sprites, with the most important being that some of the sprite drawing and sprite management functions are not supported for technical reasons, particularly those draw functions that draw only part of a sprite, or that skew the position in some way (see the individual draw_sprite_*()  functions for exact details of which). However the basic sprite drawing functions are fully supported as are the built in sprite variables. You can also set different anti-aliasing (AA) values for the SWF sprites being drawn using the functions draw_enable_swf_aa(),  draw_get_swf_aa_level() or draw_set_swf_aa_level().Now that the 2.3.0 Beta of Studio 2 is available, you will be able to see there have been a number of significant changes and additions to the Language, as well as a number of changes and additions made to the IDE. In this tech blog we'll be going over the changes to the IDE and we'll give a brief overview of the new features available. In a previous tech blog we covered the changes to the GML.

The first major change to the IDE you'll notice the moment you start up Studio 2, and it's the Asset Browser. This is the new and improved resource tree which (by default) sits on the right of the IDE and is where you can control all the assets that your project requires to run. So, what makes the asset browser different to the old resource tree? Well, a number of things...

To start with, the asset browser is more-or-less free-form now, meaning that - although new projects start with default folders - you are no longer limited to having a fixed number and order of folders for each project. So - for example - if your project doesn't use timelines or extensions, you can remove those folders from the asset list. You can also name folders as you require, so you don't even need to have folders for specific assets but can instead

A Closer Look At Gamemaker Studio 2

Posting Komentar untuk "Animation Game Maker Studio 2"