Announcement

Collapse
No announcement yet.

How to embed font using FlashDevelop and Vecorian Giotto?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to embed font using FlashDevelop and Vecorian Giotto?

    Hello. I have a small problem. I'm trying to parse an array of strings from .ini file to flash, using:
    Code:
    function SetUpSaves()
    {
        local byte i;
        local GFxObject DataProvider;
        local GFxObject TempObj;
        local GFxObject RootMC;
        local ZombiePlayerController PC;
        PC = ZombiePlayerController(GetPC());
    
        RootMC = GetVariableObject("_root");
    
        DataProvider = CreateArray();
    
        for (i = 0; i < PC.SaveName.Length; i++)
        {
    	TempObj = CreateObject("Object");
    	TempObj.SetString("SaveName", PC.SaveName[i]);
    //	TempObj.SetString("ItemType", Inventory[i].ItemType);
    //	TempObj.SetString("ItemDesc", Inventory[i].ItemDesc);
    	DataProvider.SetElementObject(i, TempObj);
        }
    
        RootMC.SetObject("saves", DataProvider);
    }
    While in ActionScript I set them up using:
    Code:
    _root.cntBtn.onRelease = function()
    		{
    			//FlashConnect.trace("WORKS");
    			_root.playBtn._visible = false;
    			_root.exitBtn._visible = false;
    			_root.cntBtn._visible = false;
    			var saves:Array = [];
    			var i:Number;
    			//for (i = 0; i < saves.length; i++)
    			for (i = 0; i < 4; i++)
    			{
    				//_root.createTextField(saves[i], _root.getNextHighestDepth(), _root._height - 100 * i, _root._width - 200, 300, 20);
    				_root.createTextField("my_txt" + i, _root.getNextHighestDepth(), _root._width / 2, _root._height / 2 + (i * 20), 300, 20);
    			        _root["my_txt"+i].border = true;
    				_root["my_txt" + i].text = saves[i].text;
    				FlashConnect.trace("WORKS");
    				
    			}
    The problem is, however, that I can't tell whether or not the saves are parsed correctly, or if the code works as it should, because instead of any readable text, or at least 'undefined' all I'm getting are few black squares. I guess it's font embedding thing, and this is my question - how can I embed fonts using Vectorian Giotto and FlashDevelop?

    #2
    If you can't embed fonts in Vectorian Giotto then you may have to use AS3 see this post

    Alternatively, download the 30 day trial for flash and embed all the fonts you may need in separate fla / swf files and set them to runtime sharing. That way you only need to compile them once and you can reuse the swf a long time after your trial runs out.

    Comment


      #3
      Well, given the fact that my net is **** lately, and I have no idea yet how to use embedded resources of another .swf, I think I'll skip the latter ;P And that's why I have two questions.
      First of all, could you say how hard would it be to translate this code (as it's the only piece of code I currently need - the main menu with play/load/exit button; same think goes for pause menu, and 'death' menu, in which I thought I could use this code as well) to AS3?
      And second - is there really no way to embed font using AS2 only?

      Comment


        #4
        All of that code could easily exist as unrealscirpt.

        1, Translating that bit of code shouldn't be too difficult
        2, As far s I know the only was to embed fonts for as2 is to embed them directly into the fla

        What exactly are you trying to do?

        Comment


          #5
          I'm reading a config string array from my PlayerController class, holding savename files, and then parse them to ActionScript to show button, if saves exists, and after clicking it make necessary number of textfields, with savenames.

          Comment


            #6
            Part of my wonders if you could just import the whole font

            Comment


              #7
              Given the fact that log gives me error: "Failed to load font None.TimesNewRoman", I don't know if importing it would help much - as I wouldn't be able to assign it to 'none' package, right?
              That's some way out though, and I guess I will have a shot at it tomorrow, thank you.

              Comment

              Working...
              X