Author Topic: Help with the position of text on a UFOpedia page  (Read 5551 times)

Offline Roxis231

  • Colonel
  • ****
  • Posts: 484
  • Catching the feral kitten hiding in my rubish bin
    • View Profile
Help with the position of text on a UFOpedia page
« on: September 09, 2014, 03:52:17 am »
This might seem odd, but does anyone know how to set up the text on a UFOpedia page: i.e. - so that its all on the right, in the bottom left or split between the top and bottom of the right.

I am currently looking at changing some of the backgrounds for my mods UFOpedia pages, and I would like the text not to cover the graphics.

Any thoughts?

Offline XOps

  • Colonel
  • ****
  • Posts: 193
  • Guy who drowns first
    • View Profile
Re: Help with the position of text on a UFOpedia page
« Reply #1 on: September 09, 2014, 06:29:30 am »
I don't really know of any way to do this easily. The type 7 UFOpedia page can only set the text to the left side. I suppose you could either use a bunch of spaces and the {NEWLINE} command to manually format the text so it appears on the right side though I don't know if it would look right or not (I think the font is monospace so it might work).  A craft entry gives you control over where the text is placed.  You could try making a dummy craft and then setting up a UFOpedia article for it while displaying the stats text in the corner off the page leaving only the text and image. To be honest though the craft thing is just a guess.

Offline Roxis231

  • Colonel
  • ****
  • Posts: 484
  • Catching the feral kitten hiding in my rubish bin
    • View Profile
Re: Help with the position of text on a UFOpedia page
« Reply #2 on: September 09, 2014, 08:23:04 am »
A craft entry gives you control over where the text is placed.  You could try making a dummy craft and then setting up a UFOpedia article for it while displaying the stats text in the corner off the page leaving only the text and image.

This sound exactly what I was after, (I think) buy HOW do you set it out, meaning what YAMAL codes do you use, and what do they do?

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Help with the position of text on a UFOpedia page
« Reply #3 on: September 09, 2014, 02:49:03 pm »
Code: [Select]
  - id: STR_SKYRANGER
    type_id: 1
    section: STR_XCOM_CRAFT_ARMAMENT
    image_id: UP004.SPK
    rect_stats:
      x: 160
      y: 5
      width: 160
      height: 60
    rect_text:
      x: 5
      y: 40
      width: 140
      height: 100
    text: STR_SKYRANGER_UFOPEDIA

Just modify rect_stats to x: 320 y: 200 and voila. You also need to add a fake "aircraft" with a matching name ofc; just make it unbuyable and without maintenance cost. Example:

Code: [Select]
crafts:
  - type: STR_MY_NEW_RESEARCH
    requires:
        - STR_MY_NEW_RESEARCH

Offline Roxis231

  • Colonel
  • ****
  • Posts: 484
  • Catching the feral kitten hiding in my rubish bin
    • View Profile
Re: Help with the position of text on a UFOpedia page
« Reply #4 on: September 09, 2014, 10:17:55 pm »
Just modify rect_stats to x: 320 y: 200 and voila. You also need to add a fake "aircraft" with a matching name ofc; just make it unbuyable and without maintenance cost. Example:

Code: [Select]
crafts:
  - type: STR_MY_NEW_RESEARCH
    requires:
        - STR_MY_NEW_RESEARCH

Thanks, this looks like just what I needed, but would " - STR_UNBIABLE_STUFF " work for the research as I intend on doing several ones.

Edit: Gave it a shot - got it to work, but either only craft stats shows up or there is no text.  Any Idea what I'm doing wrong?

What I'm Using
Code: [Select]
  - id: STR_ELERIUM_115
    requires:
      - STR_NOT_HERE
  - id: STR_TEST_1
    type_id: 1
    section: STR_ALIEN_ARTIFACTS
    image_id: MISC_RESEARCH
    requires:
      - STR_ELERIUM_115
    rect_stats:
      x: 320
      y: 200
      width: 320
      height: 200
    rect_text:
      x: 320
      y: 200
      width: 320
      height: 200
    text: STR_ELERIUM_115_UFOPEDIA
« Last Edit: September 10, 2014, 12:04:10 pm by Roxis231 »

Offline RSSwizard

  • Commander
  • *****
  • Posts: 748
    • View Profile
Re: Help with the position of text on a UFOpedia page
« Reply #5 on: September 10, 2014, 09:31:06 pm »
Do ufopaedia graphics need to be .SPK format or can they be normal images like anything else?

Ive thought about doing a full-size ufopaedia rework before, where every single thing gets a full size color image just like the Aircraft. Including all of the items, armor, HWPs, and so on. But thats a hell of alot of work and I wont even try it unless I know if its feasible.

The alternative is making them like TFTD ufopaedia and treating them the same way that the Alien Autopsy is (so rather than the right side, its just on the left side)

Offline XOps

  • Colonel
  • ****
  • Posts: 193
  • Guy who drowns first
    • View Profile
Re: Help with the position of text on a UFOpedia page
« Reply #6 on: September 10, 2014, 10:05:27 pm »
Do ufopaedia graphics need to be .SPK format or can they be normal images like anything else?

Ive thought about doing a full-size ufopaedia rework before, where every single thing gets a full size color image just like the Aircraft. Including all of the items, armor, HWPs, and so on. But thats a hell of alot of work and I wont even try it unless I know if its feasible.

The alternative is making them like TFTD ufopaedia and treating them the same way that the Alien Autopsy is (so rather than the right side, its just on the left side)

Short answer, no. Not really feasible. Long answer: UFOpedia images can by any image openXCom accepts. You can even replace the UFOpedia background windows as those are just images. Limitations have more to do with how text and stats are positioned as well as image layering. At the moment, the only article that gives you the most control is the craft article that allows you to position both the stats and the text. Other articles are impossible to change too much without using a custom EXE making it impossible to give each an individual image (already tried to do this with a mod. I wanted to have different background layouts for different kinds of weapons. No sell). There are also layering issues. The armor entry for example draws the armor image over the navigation buttons and title text which forces you to leave a transparent hole there for those to show through. Then there is the palette issue as the weapon and armor entries use the battlescape palette, the craft uses the UFOpedia palette, and the UFO entries use the geoscape palette, and finally the base facilities use the basecape palette. Here is what you can give an individual image too though.
Type 1: Crafts
Type 2: Craft Weapons
Type 5: Armor (Though you have to deal with layering issues)
Type 7: Alien Lifeforms and UFO components
Everything else though is hardcoded to one background image and only the type 1 craft articles let you move around text and stats.