![]() Is_jpeg – Determines if the memory based image file is a jpeg Memory_file_size – The size of the memory based file Memory_file – A pointer to the memory based file Name – The name you would like to assign to the file This is very useful if you want to cache the compressed versions of images in memory:īool CIwGameImage::Init(const char* name, void* memory_file, int memory_file_size, bool is_jpeg) The next change to CIwGameImage is the ability to create an image from a file that has already been loaded into memory. Note that this method will create a RGB888 image from the JPEG file, I will add support for conversion to different image pixel formats in a future release. The main method that takes care of JPEG decompression is CIwGameImage::DecompressJPEG(). However, seeing as we have already done the work for it, you may as well just rip the code straight out of IwGameImage.cpp. That said, Marmalade does provide access to LibJPG, allowing you to implement your own JPEG loader. This feature is unfortunately not supported by Marmalades image classes and missing out on JPEG compression for larger images is a bit of a pain. Ok the first change we made was to add the ability to create a CIwGameImage image from a JPEG. Well, this is all possible using the Marmalade SDK and IwGame (wow that sounded a bill salesy!) IwGameImage Changes Imagine your game running completely on dynamic content that lives on a server and you can modify it at any time, Your players will benefit greatly from new fresh content regularly. Whilst that may not be completely practical for some types of games it is for many others. Imagine a situation whereby you can distribute your basic game without having to carry around any of its content, so no graphics, no audio, no level files etc. ![]() If you just want the code to this tutorial then download it from here. In this tutorial we are going to go into that a little more as well as show you how to use CIwGameFile and CIwGameImage to download and display images from the web inside your games and apps. We also briefly mentioned that we had updated the CIwGameImage class to support JPEG’s and creation of images from memory based files. ![]() We also created a new file class that deals with local and remote file access, allowing us to download files from the web and use them in our game. In our previous tutorial we added the ability to send and receive data to and from a web server. In case you plaw Wow and you’re wondering I have Level 85 Mage, Warlock, Paladin and Druid! Unfortunately my brother rang me last night and asked me to have a few quick battles with him on World of Warcraft (I just can’t resist PvP) so as it happens, I forgot all about the time and missed publishing my next blog. yet i hope there is some combination of blend modes that gives what i'd like to achieve.This tutorial is part of the Marmalade SDK tutorials collection. in Krita if i paint with this red on this blue then it also gives dark blue boundary instead of proper anti-aliasing, strange. You can also notice that there is a boundary of the curve which tries to emulate anti-alias and that's also darker than both the curve's red color and the background's blue color, which is not the desired outcome.ĮDIT: i've checked and e.g. i hope you understand the effect i want to achieve instead of how it looks now. See the attached image what happens now, the middle of the curve is 100% opacity and it is fading out gradually towards its ends. Is there a blending mode that can achieve that? (i'm sad and surprised that this is not how it behaves with the standard blending mode) I'd prefer it to have an effect of the red dissolving on the blue. With default blending, putting a red thing with ~50% opacity on blue background gives me a color which is darker than any of the original colors. Source images and screenshot are attached below but I suggest you to also experiment with other images to better understand how blend functions work. Stage:addChild (label ) local line = Pixel.new (0圆66666, 1, lh + 11 *s, 1 ) Stage:addChild (line ) end for n = 1, 11 do local label = TextField.new ( nil, t, "|" ) Stage:addChild (label ) local line = Pixel.new (0圆66666, 1, 1, lh + 11 *s ) Lh 10 - label height local w = (application:getDeviceWidth ( ) - lh ) / 11 local h = (application:getDeviceHeight ( ) - lh ) / 11 local s = math.min (w, h ) for x = 1, 11 do for y = 1, 11 do local top = Pixel.new (topTex, s, s ) local btm = Pixel.new (btmTex, s, s )ītm:setPosition (lh + s * (x- 1 ), lh + s * (y- 1 ) ) end end local t = for k,v in pairs (Sprite ) do if tonumber (v ) = v then t = k end end for n = 1, 11 do local label = TextField.new ( nil, t, "|" ) Local topTex = Texture.new ( "top.png", true ) local btmTex = Texture.new ( "btm.png", true )
0 Comments
Leave a Reply. |