![]() surfaceoutline is just what we will draw on the screen under the original sprite. In my mind I see it to be like a hole punch we will use to erase anything we don’t want from surfaceoutline. surfacehole is a negative silhouette of the sprite including the border. ![]() ![]() You will see in my code I have two surfaces: surfacehole and surfaceoutline. What I’m going to do is a clever technique called masking, now I feel obliged to say here that this is far less efficient than the previous method, however if you want something more than a solid outline this is the best way I can think of to do it and as you can see it is running smoothly in the html5 version (which is notorious for performing code very poorly) and I am using masking on 10 objects simultaneously each of which hasn’t been optimised so is actually redrawing the whole screen each time rather than just the area around the object (and you are able to code yours more efficiently but for my purposes these are good enough for me) However after a while you will start to see some of the limitations of this you can’t do transparent borders, you can only do solid colours, you definitely cannot do clever animated things, and I’m sure there are many other problems you might get like with depth. In GameMaker one of early realisations someone might come to by themselves is how you can draw an outline around something by simply drawing a sprite 4 times in each direction and colouring those in and ta da! you have an online. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |