![]() Self.mytextfield:setAnchorPoint (self.anchorpointx, self.Support for simple, fast and memory efficient XML serialisation using memory pooling.Support for streamed IO style access to memory.Ad system uses an animation system that is producing 3%-8% CTR IwGameAd engine which mediates ad collection, display and click processing across multiple ad providers (12 providers supported to date).Auto handles frame rate variations to produce smooth animation.Auto handles resizing to any size / aspect ratio display using virtual canvasses.Global and scene local resources, including automated clean-up.Support for programs and command, allowing definition of game and application logic using mark-up.Includes XML schema enabling validation, intellisense and auto complete. Self.mytextfield:setTextColor (pcolor or 0xff0000 ) Self.mytextfield:setSample (ptext ) - self.mytextfield:setLayout( ) end Self.mytextfield = TextField.new (pfont, ptext, ptext ) Self.anchorpointx = 0.5 - self.anchorpointy = 0.5 (This makes sample almost useless I think)įunction xCenteredTextFieldW:init (ptext, pfont, pcolor, pw, ph, pline ) Still being able to use metrics of a specific set of characters instead of font metrics is useful, but must find a way to merge both behaviours somehow.Ģ) add a sample field in the layout parametersģ) have layout honour that sample field when computing the metricsĤ) have layout use ref_top by default if a layout parameter table is suppliedĥ) have layout interprets ref_top as whatever is correct for the currently rendered text, irrespective of the font metrics or sample. I didn't know myself that setSample would offset the text. This is consistent with you see and yes it is difficult to understand if you don't know what it does. If both are used, both offsets are applied. So I dug into the rendering code to understand better what setSample was doing and things are a bit messy currently.ġ) setSample works by computing the top-left position of the supplied sample text relative to its origin and offseting the real textfield content according to it.Ģ) layout on the other hand uses global font metrics (ascender/height/descender) and offsets text by ascender value when selecting REF_TOP The question is how to make it the default without breaking existing projects too much ? ![]() But that's my opinion.īack to TLF_REF_TOP vs TLF_REF_BASELINE, I totally agree with you that REF_TOP should have been the default. I admit I have never been in favor of that option, and the guy who added it to gideros hasn't been seen here in a while, so unless someone finds it extremely useful and wants to maintain it, I think it should be dropped completely. I understand its benefits, but I the way it is implemented doesn't fit well with layout. With this flag added text will appear as you first expected.Ībout setSample, it was, in my mind, supposed to give a way to replace the font line height with the height of a specific sample of text. There is layout flag you can use to switch to top ref though: FontBase.TLF_REF_TOP. I thought it was better to keep consistency with old behaviour as much as possible, it may have been a bad move at that time, and it could be changed by that could break some existing apps. Textfield used to work on the baseline before layout (in a box) was introduced. Why baseline is used instead of top ref ? because of legacy.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |