iopyi.blogg.se

Stencyl background
Stencyl background









stencyl background

Setting the width/height of an image instance is done in relative (percentage) format, so 200% will double its size in that dimension while 50% will halve it. Consider using the relative layering features instead (move back/forward a layer, to front/back). Note: Setting the z-order as a number can be finnicky if you provide too high a value. It's strictly to control ordering of elements within what it's attached to. It does not switch the layer it's attached to or anything like that. Once you've created an image instance, you can manipulate its properties much like a regular actor.Īltering the z-order for an image instance will do so within the confines of what it's attached to. What they really meant to do was save that instance to an attribute for future reference. The problem is that they are creating a brand new instance for each subsequent operation. They find themselves doing the following and wondering why their image instance is doing nothing. New users often make a common mistake when creating instances. Attach it to a specific layer in the scene.In order to display an image on your game, you must create an image instance and then attach that image instance to the scene. Many of these operations, particularly pixel swap, effects and masks perform these operations in software, so they are not meant to be used in real-time but rather, applied sparingly. This informs the system not to push an image's updates to all its instances until you've finished your work.

stencyl background

When setting many pixels at a time, use the batch draw block (placed right above the set pixel block). Note: When using files from the extras folder, make sure the images were saved with transparency enabled. Values in between the two extremes are fine and will be treated as expected.Ĭonversely, when using retain, anything black in an image will be kept, while anything transparent will be cleared out. When using clear, anything black in an image will be cleared out, while anything transparent will be retained. You can use this block to cut out shapes from an image, perfect for lighting effects. The clear/retain image using image block is a powerful way to apply masks to an image. Note: All of these operations are permanent, so there is no way to undo them. Apply an effect (the same ones used for actors) to an image.Clear a part of an image (or the whole image).Note that if you create instances of the same image, modifying the original image will modify what each of those instances is displaying. Once you've created an image, you can perform drawing operations on that image. It takes time and is meant to be used sparingly, not every frame! Drawing on Images Use the image from file block to load them into images.ĭo not abuse the capture screenshot feature.Create an extras folder under your game's folder.Tip: Use the menu item: Debug > View > View Folder for this Game to reveal your game's folder. You can load an image from a bundled file by following these steps. When creating images, you almost always want to create an Image attribute, so that you can refer to the image in the future. Use an Actor's current drawing as an image.Īlways Do This: Create Attributes for Images.Capture a screenshot of the game's current view and use that as an image.Create an image from part of an existing image.Create a blank image with Width/Height.One is a template, and the other's the actual instance of the thing. This distinction isn't all that different from the different between an Actor Type and an Actor (Instance). In ActionScript, they are equivalent to Bitmaps. In order to do that, you have to create an instance of an image, conveniently called an Image Instance. Images in themselves aren't displayed in game. In ActionScript, they are equivalent to BitmapData. Images are literally, the images themselves. In order to use the Image API, you need to understand two things - Images and Image Instances. This sounds abstract, and rather than going handwavy about it, see the following demos to get a taste of what can be accomplished. The Image API lets you do this, by letting you create, modify and manipulate plain images in your game. When people push the limits of what Stencyl can do, they often create tons of actors, dragging the game's performance down, leading to misguided perceptions that the Stencyl engine is "slow." In reality, what's missing are better ways to accomplish visual eye candy without actors. The problem with this approach is that Actors do a lot of things, and this limits how many Actors can be on screen at one time. If you want to accomplish something, you create an Actor. Up until this point, Stencyl has been based around Actors.











Stencyl background