Forums
Members
Registered members
Current visitors
New profile posts
Search profile posts
Latest activity
New posts
Fan Games
All Game Jams
Completed Releases
Playable Demos
All Releases
Other Releases
Development
Resources
Search resources
Feedback
Pokémon Essentials Wiki
Team Recruitment
Streams
Multi-Viewer
Log in
Register
What's new
Search
Search
Search titles only
By:
Members
Registered members
Current visitors
New profile posts
Search profile posts
Latest activity
New posts
Menu
Log in
Register
Install the app
Install
Forums
Pokémon Essentials
Questions
Help with Custom Credits
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Gardenette" data-source="post: 43433" data-attributes="member: 13256"><p>I need some help with my custom credits script.</p><p>What I'm trying to accomplish: I want a custom icon to appear next to specific people's names. If there exists a file in Graphics/Pictures/Credits/person's name, I want to put that icon next to their name.</p><p></p><p>Here is my problem:</p><p>When I run the credits, the first file aligns perfectly. The second file is not at the same height as the name Gardenette, and it only gets worse as it goes on. Here is a picture.</p><p>[ATTACH=full]12356[/ATTACH]</p><p>The image of 4 red arrows should appear next to Saltilton, which it does.</p><p>The image of the player head should appear next to Gardenette, and it appears 32 pixels lower than it should.</p><p></p><p>Both images are 32x32.</p><p>[ATTACH=full]12357[/ATTACH]</p><p>[ATTACH=full]12358[/ATTACH]</p><p>[ATTACH=full]12359[/ATTACH]</p><p></p><p>Here is the code:</p><p>[SPOILER]</p><p>=====================================================================================================</p><p><strong>#==============================================================================</strong></p><p><strong># * Scene_Credits</strong></p><p><strong>#------------------------------------------------------------------------------</strong></p><p><strong># Scrolls the credits you make below. Original Author unknown.</strong></p><p><strong>#</strong></p><p><strong>## Edited by MiDas Mike so it doesn't play over the Title, but runs by calling</strong></p><p><strong># the following:</strong></p><p><strong># $scene = Scene_Credits.new</strong></p><p><strong>#</strong></p><p><strong>## New Edit 3/6/2007 11:14 PM by AvatarMonkeyKirby.</strong></p><p><strong># Ok, what I've done is changed the part of the script that was supposed to make</strong></p><p><strong># the credits automatically end so that way they actually end! Yes, they will</strong></p><p><strong># actually end when the credits are finished! So, that will make the people you</strong></p><p><strong># should give credit to now is: Unknown, MiDas Mike, and AvatarMonkeyKirby.</strong></p><p><strong># -sincerly yours,</strong></p><p><strong># Your Beloved</strong></p><p><strong># Oh yea, and I also added a line of code that fades out the BGM so it fades</strong></p><p><strong># sooner and smoother.</strong></p><p><strong>#</strong></p><p><strong>## New Edit 24/1/2012 by Maruno.</strong></p><p><strong># Added the ability to split a line into two halves with <s>, with each half</strong></p><p><strong># aligned towards the centre. Please also credit me if used.</strong></p><p><strong>#</strong></p><p><strong>## New Edit 22/2/2012 by Maruno.</strong></p><p><strong># Credits now scroll properly when played with a zoom factor of 0.5. Music can</strong></p><p><strong># now be defined. Credits can't be skipped during their first play.</strong></p><p><strong>#</strong></p><p><strong>## New Edit 25/3/2020 by Maruno.</strong></p><p><strong># Scroll speed is now independent of frame rate. Now supports non-integer values</strong></p><p><strong># for SCROLL_SPEED.</strong></p><p><strong>#</strong></p><p><strong>## New Edit 21/8/2020 by Marin.</strong></p><p><strong># Now automatically inserts the credits from the plugins that have been</strong></p><p><strong># registered through the PluginManager module.</strong></p><p><strong>#==============================================================================</strong></p><p><strong>class Scene_Credits</strong></p><p><strong> # Backgrounds to show in credits. Found in Graphics/Titles/ folder</strong></p><p><strong> BACKGROUNDS_LIST = ["credits1", "credits2", "credits3", "credits4", "credits5"]</strong></p><p><strong> BGM = "Credits"</strong></p><p><strong> SCROLL_SPEED = 190 # Pixels per second, was 40</strong></p><p><strong> SECONDS_PER_BACKGROUND = 11</strong></p><p><strong> TEXT_OUTLINE_COLOR = Color.new(0, 0, 128, 255)</strong></p><p><strong> TEXT_BASE_COLOR = Color.new(255, 255, 255, 255)</strong></p><p><strong> TEXT_SHADOW_COLOR = Color.new(0, 0, 0, 100)</strong></p><p><strong></strong></p><p><strong> # This next piece of code is the credits.</strong></p><p><strong> # Start Editing</strong></p><p><strong> CREDIT = <<<em>END</em></strong></p><p><strong>Saltilton</strong></p><p><strong>Gardenette</strong></p><p><strong>Scripts & Coding</strong></p><p><strong>----------------</strong></p><p><strong>Advanced Map Transfers:</strong></p><p><strong>Luka S.J.</strong></p><p><strong></strong></p><p><strong>Always in Bushes:</strong></p><p><strong>Kotaro</strong></p><p><strong>KleinStudio</strong></p><p><strong></strong></p><p><strong>Ambient Pokémon Cries:</strong></p><p><strong>Vendily</strong></p><p><strong>SpaceWestern</strong></p><p><strong></strong></p><p><strong>Astralneko's Scripting Utilities:</strong></p><p><strong>Astralneko</strong></p><p><strong></strong></p><p><strong>Bag Screen with Interactable Party:</strong></p><p><strong>DiegoWT</strong></p><p><strong>Rose</strong></p><p><strong>Vendily</strong></p><p><strong></strong></p><p><strong>Better Region Map:</strong></p><p><strong>Marin</strong></p><p><strong>Boonzeet</strong></p><p><strong></strong></p><p><strong>New DexNav:</strong></p><p><strong>Phantombass</strong></p><p><strong>suzerain</strong></p><p><strong>NuriYuri</strong></p><p><strong>raZ</strong></p><p><strong>Vendily</strong></p><p><strong>Savordez</strong></p><p><strong>Marin</strong></p><p><strong>Zaffre</strong></p><p><strong>ThatWelshOne_</strong></p><p><strong></strong></p><p><strong>DiegoWT's Starter Selection:</strong></p><p><strong>DiegoWT</strong></p><p><strong></strong></p><p><strong>DPPT Gender Selector Scene:</strong></p><p><strong>A.Somersault</strong></p><p><strong></strong></p><p><strong>Easy Text Skip:</strong></p><p><strong>Amethyst</strong></p><p><strong>Kurotsune</strong></p><p><strong>ENLS</strong></p><p><strong></strong></p><p><strong>Easy Mouse System:</strong></p><p><strong>Luka S.J.</strong></p><p><strong></strong></p><p><strong>Evolve from Party:</strong></p><p><strong>IndianAnimator</strong></p><p><strong>eriedaberrie#1569</strong></p><p><strong></strong></p><p><strong>EVs and IVs in Summary:</strong></p><p><strong>Deoxysprime</strong></p><p><strong></strong></p><p><strong>Following Pokémon EX:</strong></p><p><strong>Golisopod User</strong></p><p><strong>Help-14</strong></p><p><strong>zingzags</strong></p><p><strong>Rayd12smitty</strong></p><p><strong>Venom12</strong></p><p><strong>mej71</strong></p><p><strong>PurpleZaffre</strong></p><p><strong>Akizakura16</strong></p><p><strong>Thundaga</strong></p><p><strong>Armin</strong></p><p><strong>Maruno</strong></p><p><strong></strong></p><p><strong>Item Find:</strong></p><p><strong>Boonzeet</strong></p><p><strong></strong></p><p><strong>Location Signposts:</strong></p><p><strong>LostSoulsDev</strong></p><p><strong>carmaniac</strong></p><p><strong>PurpleZaffre</strong></p><p><strong>Golisopod User</strong></p><p><strong></strong></p><p><strong>Luka's Scripting Utilities:</strong></p><p><strong>Luka S.J.</strong></p><p><strong></strong></p><p><strong>Marin's Scripting Utilities:</strong></p><p><strong>Marin</strong></p><p><strong></strong></p><p><strong>Modern Quest System + UI:</strong></p><p><strong>ThatWelshOne_</strong></p><p><strong>mej71</strong></p><p><strong>derFischae</strong></p><p><strong>Marin</strong></p><p><strong></strong></p><p><strong>Overworld Shadows EX:</strong></p><p><strong>Golisopod User</strong></p><p><strong>Wolf PP</strong></p><p><strong>Marin</strong></p><p><strong></strong></p><p><strong>Monitor Icons:</strong></p><p><strong>Ulithium_Dragon</strong></p><p><strong>bo4p5687</strong></p><p><strong>ThatWelshOne_</strong></p><p><strong>raZ</strong></p><p><strong>Marin</strong></p><p><strong>Maruno</strong></p><p><strong>Nuri Yuri</strong></p><p><strong>PurpleZaffre</strong></p><p><strong>Savordez</strong></p><p><strong>Vendily</strong></p><p><strong>SpaceWestern</strong></p><p><strong>Gardenette</strong></p><p><strong></strong></p><p><strong>Pokémon Amie:</strong></p><p><strong>PizzaSun</strong></p><p><strong>rigbycwts</strong></p><p><strong>BhagyaJyoti</strong></p><p><strong>Luka S.J</strong></p><p><strong>bo4p5687</strong></p><p><strong></strong></p><p><strong>Quicksave:</strong></p><p><strong>Low</strong></p><p><strong></strong></p><p><strong>Speed Up 2.0:</strong></p><p><strong>Marin</strong></p><p><strong>Phantombass</strong></p><p><strong></strong></p><p><strong>Video with Using Gif:</strong></p><p><strong>bo4p5687</strong></p><p><strong></strong></p><p><strong>Voltseon's A-Star Pathfinding:</strong></p><p><strong>Voltseon</strong></p><p><strong>Golisopod User</strong></p><p><strong>ENLS</strong></p><p><strong></strong></p><p><strong>Voltseon's Pause Menu:</strong></p><p><strong>Voltseon</strong></p><p><strong>Golisopod User</strong></p><p><strong>ENLS</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>Graphics</strong></p><p><strong>--------</strong></p><p><strong>Tilesets:</strong></p><p><strong>Tyler Jones - Environmental Designer</strong></p><p><strong>GreenJellybean</strong></p><p><strong>ventesthefloof</strong></p><p><strong>Griffin L</strong></p><p><strong>Kaloja</strong></p><p><strong>Saltilton</strong></p><p><strong>Aveon Trainer</strong></p><p><strong>Derlo</strong></p><p><strong>King Tapia</strong></p><p><strong>Magiscarf</strong></p><p><strong>Princess Phoenix</strong></p><p><strong>Donlawride</strong></p><p><strong>aball</strong></p><p><strong>Cristata</strong></p><p><strong>Groogey</strong></p><p><strong>ShadySheep</strong></p><p><strong>the.sizzlepanda</strong></p><p><strong>Rider Dragon</strong></p><p><strong></strong></p><p><strong>Pokémon & Pokédex:</strong></p><p><strong>Jack</strong></p><p><strong>Claire</strong></p><p><strong>Evelyn315</strong></p><p><strong>Akikaze</strong></p><p><strong>Firedude</strong></p><p><strong>LuckyBenjamin the Appletun</strong></p><p><strong>Loretze</strong></p><p><strong>Applesaucior</strong></p><p><strong>farbol234</strong></p><p><strong>SoundJack426</strong></p><p><strong>8xviktor</strong></p><p><strong>ventesthefloof</strong></p><p><strong>RockTomb</strong></p><p><strong>Ian (The Picky Pixel Artist)</strong></p><p><strong>Saltilton</strong></p><p><strong>theWaterleaf</strong></p><p><strong>Soda</strong></p><p><strong>Lorka_Grey</strong></p><p><strong>KameOtaku</strong></p><p><strong>Dan Bacon</strong></p><p><strong>MillerMiller</strong></p><p><strong>Cristata</strong></p><p><strong>I’m Para</strong></p><p><strong>Jeremy K</strong></p><p><strong>Hub-Bub</strong></p><p><strong>Master_Machi</strong></p><p><strong>Pelican</strong></p><p><strong>Bean Soup</strong></p><p><strong>A Happi Rapter</strong></p><p><strong>aball</strong></p><p><strong>Bee</strong></p><p><strong>Chespin (Ethan)</strong></p><p><strong>Chromatech01</strong></p><p><strong>Eshan</strong></p><p><strong>Fikolyte</strong></p><p><strong>Floriak</strong></p><p><strong>gribbin</strong></p><p><strong>Grimrose</strong></p><p><strong>Igor!</strong></p><p><strong>MarsTemple</strong></p><p><strong>Regal-Turtwig</strong></p><p><strong>ShadySheep</strong></p><p><strong>SietseML</strong></p><p><strong>Solvaa</strong></p><p><strong>SomeAllay</strong></p><p><strong>WillTheWall</strong></p><p><strong></strong></p><p><strong>Trainers/NPCs:</strong></p><p><strong>Jack</strong></p><p><strong>Claire</strong></p><p><strong>Loretze</strong></p><p><strong>ventesthefloof</strong></p><p><strong>RockTomb</strong></p><p><strong>Saltilton</strong></p><p><strong>HingisDingus</strong></p><p><strong>Chespin (Ethan)</strong></p><p><strong>Akikaze</strong></p><p><strong>KameOtaku</strong></p><p><strong>Gardenette</strong></p><p><strong>Zacharie</strong></p><p><strong>MillerMiller</strong></p><p><strong>Bee</strong></p><p><strong>TheRoyalDex</strong></p><p><strong>MILKMAN</strong></p><p><strong></strong></p><p><strong>UI & Misc.:</strong></p><p><strong>Random Talking Bush</strong></p><p><strong>aball</strong></p><p><strong>Adam</strong></p><p><strong>Dan Bacon</strong></p><p><strong>Basalte</strong></p><p><strong>HwiteHwale</strong></p><p><strong>MillerMiller</strong></p><p><strong>Gardenette</strong></p><p><strong>MANGO</strong></p><p><strong>MarsTemple</strong></p><p><strong>Riot</strong></p><p><strong>Master_Machi</strong></p><p><strong>Chespin (Ethan)</strong></p><p><strong>Jackster</strong></p><p><strong>Saltilton</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>Music</strong></p><p><strong>-----</strong></p><p><strong>Soundtrack:</strong></p><p><strong>Rhythm Break</strong></p><p><strong>ReMX Bossa Nova</strong></p><p><strong></strong></p><p><strong>Pokémon Cries:</strong></p><p><strong>Gardenette</strong></p><p><strong>Text 206</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>Mapping</strong></p><p><strong>-------</strong></p><p><strong>stygma</strong></p><p><strong>ImaDeadMan</strong></p><p><strong>Gardenette</strong></p><p><strong>Kaloja</strong></p><p><strong>GreenJellybean</strong></p><p><strong>MANGO</strong></p><p><strong>RISH</strong></p><p><strong>Shadows</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>Eventing</strong></p><p><strong>--------</strong></p><p><strong>Low</strong></p><p><strong>SpaceWestern</strong></p><p><strong>stygma</strong></p><p><strong>Gardenette</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>Story & Quests</strong></p><p><strong>--------------</strong></p><p><strong>Angel</strong></p><p><strong>BlueLightning</strong></p><p><strong>Firedude</strong></p><p><strong>Kyl-E</strong></p><p><strong>Gardenette</strong></p><p><strong>ThisGrainCharacter (Gluten Free)</strong></p><p><strong>DeinoNuggies</strong></p><p><strong>HwiteHwale</strong></p><p><strong>Krabby Enthusiast</strong></p><p><strong>Luc_</strong></p><p><strong>Shilo</strong></p><p><strong>sneakysnek</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>Game Data & Balancing</strong></p><p><strong>---------------------</strong></p><p><strong>Malarkey3072</strong></p><p><strong>Kyl-E</strong></p><p><strong>Low</strong></p><p><strong>SpaceWestern</strong></p><p><strong>stygma</strong></p><p><strong>Gardenette</strong></p><p><strong>MacheteMcGoo</strong></p><p><strong>noahthenumbat</strong></p><p><strong>DomTom</strong></p><p><strong><3 w <3</strong></p><p><strong>Adam</strong></p><p><strong>caesar</strong></p><p><strong>Empyrean</strong></p><p><strong>Garreon</strong></p><p><strong>Hare64</strong></p><p><strong>HwiteHwale</strong></p><p><strong>MarsTemple</strong></p><p><strong>Midbus</strong></p><p><strong>mSilk</strong></p><p><strong>Robochef9000</strong></p><p><strong>Señor Gallo de Caballo</strong></p><p><strong>Shadows</strong></p><p><strong>Waffler</strong></p><p><strong>Zyuran</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>Translating</strong></p><p><strong>-----------</strong></p><p><strong>Blind guy,i guess</strong></p><p><strong>Fitch</strong></p><p><strong>Basalte</strong></p><p><strong>Floriak</strong></p><p><strong>Hey</strong></p><p><strong>Truegear</strong></p><p><strong>Wowo</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>Playtesting</strong></p><p><strong>-----------</strong></p><p><strong>Chespin (Ethan)</strong></p><p><strong>ventesthefloof</strong></p><p><strong>BlueLightning</strong></p><p><strong>Saltilton</strong></p><p><strong>Blind guy,i guess</strong></p><p><strong>Jamadxx</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>Team Organization</strong></p><p><strong>-----------------</strong></p><p><strong>stygma</strong></p><p><strong>Katie</strong></p><p><strong>HingisDingus</strong></p><p><strong>Gardenette</strong></p><p><strong>Master_Machi</strong></p><p><strong>Bee</strong></p><p><strong>Luc_</strong></p><p><strong>MarsTemple</strong></p><p><strong>Firedude</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>Mazah Region Created by</strong></p><p><strong>-----------------------</strong></p><p><strong>Subjectively</strong></p><p><strong>Jack</strong></p><p><strong>Claire</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>Special Thanks</strong></p><p><strong>--------------</strong></p><p><strong>"Pokémon Essentials" was created by:</strong></p><p><strong>Flameguru</strong></p><p><strong>Poccil (Peter O.)</strong></p><p><strong>Maruno</strong></p><p><strong></strong></p><p><strong>With contributions from:</strong></p><p><strong>AvatarMonkeyKirby</strong></p><p><strong>Marin</strong></p><p><strong>Boushy</strong></p><p><strong>MiDas Mike</strong></p><p><strong>Brother1440</strong></p><p><strong>Near Fantastica</strong></p><p><strong>FL.</strong></p><p><strong>PinkMan</strong></p><p><strong>Genzai Kawakami</strong></p><p><strong>Popper</strong></p><p><strong>Golisopod User</strong></p><p><strong>Rataime</strong></p><p><strong>help-14</strong></p><p><strong>Savordez</strong></p><p><strong>IceGod64</strong></p><p><strong>SoundSpawn</strong></p><p><strong>Jacob O. Wobbrock</strong></p><p><strong>the__end</strong></p><p><strong>KitsuneKouta</strong></p><p><strong>Venom12</strong></p><p><strong>Lisa Anthony</strong></p><p><strong>Wachunga</strong></p><p><strong>Luka S.J.</strong></p><p><strong>Derxwna Kapsyla</strong></p><p><strong>and everyone else who helped out</strong></p><p><strong></strong></p><p><strong>"mkxp-z" by:</strong></p><p><strong>Roza</strong></p><p><strong>Based on MKXP by Ancurio et al.</strong></p><p><strong></strong></p><p><strong>"RPG Maker XP" by:</strong></p><p><strong>Enterbrain</strong></p><p><strong></strong></p><p><strong>Pokémon is owned by:</strong></p><p><strong>The Pokémon Company</strong></p><p><strong>Nintendo</strong></p><p><strong>Affiliated with Game Freak</strong></p><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>This is a non-profit fan-made game.</strong></p><p><strong>No copyright infringements intended.</strong></p><p><strong>Please support the official games!</strong></p><p><strong>{INSERTS_PLUGIN_CREDITS_DO_NOT_REMOVE}</strong></p><p><strong><em>END</em></strong></p><p><strong># Stop Editing</strong></p><p><strong></strong></p><p><strong> def main</strong></p><p><strong> @creditsEnd = 0</strong></p><p><strong> #-------------------------------</strong></p><p><strong> # Animated Background Setup</strong></p><p><strong> #-------------------------------</strong></p><p><strong> @counter = 0.0 # Counts time elapsed since the background image changed</strong></p><p><strong> @bg_index = 0</strong></p><p><strong> @bitmap_height = Graphics.height # For a single credits text bitmap</strong></p><p><strong> @trim = Graphics.height / 10</strong></p><p><strong> # Number of game frames per background frame</strong></p><p><strong> @realOY = -(Graphics.height - @trim)</strong></p><p><strong> #-------------------------------</strong></p><p><strong> # Credits text Setup</strong></p><p><strong> #-------------------------------</strong></p><p><strong> plugin_credits = ""</strong></p><p><strong> PluginManager.plugins.each do |plugin|</strong></p><p><strong> pcred = PluginManager.credits(plugin)</strong></p><p><strong> CREDIT.gsub!(/\{INSERTS_PLUGIN_CREDITS_DO_NOT_REMOVE\}/, plugin_credits)</strong></p><p><strong> @credit_lines = CREDIT.split(/\n/)</strong></p><p><strong> plugin_credits << "\"#{plugin}\" v.#{PluginManager.version(plugin)} by:\n"</strong></p><p><strong> if pcred.size >= 5</strong></p><p><strong> plugin_credits << pcred[0] + "\n"</strong></p><p><strong> i = 1</strong></p><p><strong> until i >= pcred.size</strong></p><p><strong> plugin_credits << pcred<em> + "<s>" + (pcred[i + 1] || "") + "\n"</em></strong></p><p><strong><em> i += 2</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em> else</em></strong></p><p><strong><em> pcred.each { |name| plugin_credits << name + "\n" }</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em> plugin_credits << "\n"</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em> </em></strong></p><p><strong><em></em></strong></p><p><strong><em> #-------------------------------</em></strong></p><p><strong><em> # Make background and text sprites</em></strong></p><p><strong><em> #-------------------------------</em></strong></p><p><strong><em> @text_viewport = Viewport.new(0, @trim, Graphics.width, Graphics.height - (@trim * 2))</em></strong></p><p><strong><em> @text_viewport.z = 99999</em></strong></p><p><strong><em> </em></strong></p><p><strong><em> @background_sprite = IconSprite.new(0, 0)</em></strong></p><p><strong><em> @background_sprite.setBitmap("Graphics/Titles/" + BACKGROUNDS_LIST[0])</em></strong></p><p><strong><em> @background_sprite.opacity = 0</em></strong></p><p><strong><em> @credit_sprites = []</em></strong></p><p><strong><em> @contributor_sprites = {}</em></strong></p><p><strong><em> @total_height = @credit_lines.size * 32</em></strong></p><p><strong><em> lines_per_bitmap = @bitmap_height / 32</em></strong></p><p><strong><em> num_bitmaps = (@credit_lines.size.to_f / lines_per_bitmap).ceil</em></strong></p><p><strong><em> </em></strong></p><p><strong><em> #there are 42 bitmaps right now, so for i in 0...42 (iterate 42 times)</em></strong></p><p><strong><em> for i in 0...num_bitmaps</em></strong></p><p><strong><em> #the width and height match the size of the screen</em></strong></p><p><strong><em> credit_bitmap = Bitmap.new(Graphics.width, @bitmap_height)</em></strong></p><p><strong><em> #Sets a bitmap's font to the system font.</em></strong></p><p><strong><em> pbSetSystemFont(credit_bitmap)</em></strong></p><p><strong><em> #j is the iteration letter</em></strong></p><p><strong><em> #lines_per_bitmap is 12</em></strong></p><p><strong><em> #so for j in 0...12 (12 times), but it goes more than 12 times</em></strong></p><p><strong><em> for j in 0...lines_per_bitmap</em></strong></p><p><strong><em> #line = blank. The first line in the credits</em></strong></p><p><strong><em> #@credit_lines = the entire credits all in one array</em></strong></p><p><strong><em> #i = 0, since this is the first iteration</em></strong></p><p><strong><em> #lines_per_bitmap = 12</em></strong></p><p><strong><em> #j = 0, the first iteration, then 1, 2, all the way to 11</em></strong></p><p><strong><em> #(12 iterations)</em></strong></p><p><strong><em> #so it's</em></strong></p><p><strong><em> #line = @credit_lines array, position [0 * 12 + 0] = @credit_lines[0]</em></strong></p><p><strong><em> line = @credit_lines[i * lines_per_bitmap + j]</em></strong></p><p><strong><em> next if !line</em></strong></p><p><strong><em> #if the line is not empty as in has no value and we've reached the end?</em></strong></p><p><strong><em> #split the line when you find a <s></em></strong></p><p><strong><em> line = line.split("<s>")</em></strong></p><p><strong><em> xpos = 0</em></strong></p><p><strong><em> align = 1 # Centre align</em></strong></p><p><strong><em> linewidth = Graphics.width</em></strong></p><p><strong><em> #k is the iteration letter</em></strong></p><p><strong><em> #line.length is 0 if the line is empty and 1 if there is anything on the</em></strong></p><p><strong><em> #line</em></strong></p><p><strong><em> for k in 0...line.length</em></strong></p><p><strong><em> #so for k in 0...line.length (2 times?)</em></strong></p><p><strong><em> #k is just 0 over and over</em></strong></p><p><strong><em> if line.length > 1</em></strong></p><p><strong><em> #I have no idea what's going on here. Something about alignment</em></strong></p><p><strong><em> xpos = (k == 0) ? 0 : 20 + Graphics.width / 2</em></strong></p><p><strong><em> align = (k == 0) ? 2 : 0 # Right align : left align</em></strong></p><p><strong><em> linewidth = Graphics.width / 2 - 20</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em> #change the font color of text put on the bitmap</em></strong></p><p><strong><em> credit_bitmap.font.color = TEXT_SHADOW_COLOR</em></strong></p><p><strong><em> #draw the shadow of the text on the bitmap</em></strong></p><p><strong><em> #xpos = 0 over and over</em></strong></p><p><strong><em> #y is j*32+8, which comes out to 40, 72, 104, 136, etc and eventually</em></strong></p><p><strong><em> #loops back to 0 if it passes the screen height. The +8 is just for</em></strong></p><p><strong><em> #the shadow.</em></strong></p><p><strong><em> #so draw_text(x = 0, y = 0, width = linewidth, height = 32, what to</em></strong></p><p><strong><em> #draw is the contents of line[k] so "Scripts & Coding" which is the</em></strong></p><p><strong><em> #first line in the credits, alignment)</em></strong></p><p><strong><em> credit_bitmap.draw_text(xpos, j * 32 + 8, linewidth, 32, line[k], align)</em></strong></p><p><strong><em> credit_bitmap.font.color = TEXT_OUTLINE_COLOR</em></strong></p><p><strong><em> credit_bitmap.draw_text(xpos + 2, j * 32 - 2, linewidth, 32, line[k], align)</em></strong></p><p><strong><em> credit_bitmap.draw_text(xpos, j * 32 - 2, linewidth, 32, line[k], align)</em></strong></p><p><strong><em> credit_bitmap.draw_text(xpos - 2, j * 32 - 2, linewidth, 32, line[k], align)</em></strong></p><p><strong><em> credit_bitmap.draw_text(xpos + 2, j * 32, linewidth, 32, line[k], align)</em></strong></p><p><strong><em> credit_bitmap.draw_text(xpos - 2, j * 32, linewidth, 32, line[k], align)</em></strong></p><p><strong><em> credit_bitmap.draw_text(xpos + 2, j * 32 + 2, linewidth, 32, line[k], align)</em></strong></p><p><strong><em> credit_bitmap.draw_text(xpos, j * 32 + 2, linewidth, 32, line[k], align)</em></strong></p><p><strong><em> credit_bitmap.draw_text(xpos - 2, j * 32 + 2, linewidth, 32, line[k], align)</em></strong></p><p><strong><em> credit_bitmap.font.color = TEXT_BASE_COLOR </em></strong></p><p><strong><em> #draw the contents of line[k] to the bitmap</em></strong></p><p><strong><em> #j is 0...12 and goes (12 times). It's the number of lines per the</em></strong></p><p><strong><em> #bitmap</em></strong></p><p><strong><em> #j*32 is 32,64,96,128,192,224,256,320,0,64,96,160,192,224,256,320,352,</em></strong></p><p><strong><em> #0,etc.</em></strong></p><p><strong><em> #it seems the bitmap's height is 352. Once the y reaches 352, the next</em></strong></p><p><strong><em> #bit of text's y starts at 0 or whatever is leftover when going over</em></strong></p><p><strong><em> #352</em></strong></p><p><strong><em> credit_bitmap.draw_text(xpos, j * 32, linewidth, 32, line[k], align)</em></strong></p><p><strong><em> #I need to check if the contents of line[k] exist as a file in</em></strong></p><p><strong><em> #pictures/credits, and it if does, put it at height j*32 in this loop</em></strong></p><p><strong><em> #that should put the graphic in the correct spot next to the name</em></strong></p><p><strong><em> #but for now I will check if line[k] equals a specific string and if</em></strong></p><p><strong><em> #it does, I will place a sprite at j*32 on this bitmap</em></strong></p><p><strong><em></em></strong></p><p><strong><em></em></strong></p><p><strong><em> </em></strong></p><p><strong><em> name = line[k].to_s</em></strong></p><p><strong><em> if FileTest.image_exist?("Graphics/Pictures/Credits/" + name)</em></strong></p><p><strong><em> #create a new sprite for line[k]</em></strong></p><p><strong><em> @contributor_sprites[name+"-#{i}-#{j}"] = Sprite.new(@text_viewport)</em></strong></p><p><strong><em> #make the sprite a bitmap</em></strong></p><p><strong><em> @contributor_sprites[name+"-#{i}-#{j}"].bitmap = Bitmap.new("Graphics/Pictures/Credits/" + name)</em></strong></p><p><strong><em> #set the x of that bitmap sprite (the person's graphic)</em></strong></p><p><strong><em> @contributor_sprites[name+"-#{i}-#{j}"].x = 0</em></strong></p><p><strong><em> #set the y of that bitmap sprite (the person's graphic)</em></strong></p><p><strong><em> #j * 32 is the height the name appears at on this bitmap, whether it's</em></strong></p><p><strong><em> #0,32,64, etc.</em></strong></p><p><strong><em> name_height = j * 32</em></strong></p><p><strong><em> @contributor_sprites[name+"-#{i}-#{j}"].y = name_height + @bitmap_height * i</em></strong></p><p><strong><em> #print name+"-#{i}-#{j}"</em></strong></p><p><strong><em> #print name + ".y is " + @contributor_sprites[name].y.to_s</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em> </em></strong></p><p><strong><em> end</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em> #all this below is in the for i loop</em></strong></p><p><strong><em> #put all the bitmaps together</em></strong></p><p><strong><em> credit_sprite = Sprite.new(@text_viewport)</em></strong></p><p><strong><em> credit_sprite.bitmap = credit_bitmap</em></strong></p><p><strong><em> credit_sprite.z = 9998</em></strong></p><p><strong><em></em></strong></p><p><strong><em> #create the long bitmap for the contributor sprites</em></strong></p><p><strong><em>=begin</em></strong></p><p><strong><em> contributor_sprite = Sprite.new(@cont_viewport)</em></strong></p><p><strong><em> contributor_sprite.bitmap = credit_bitmap</em></strong></p><p><strong><em> contributor_sprite.z = 9997</em></strong></p><p><strong><em>=end</em></strong></p><p><strong><em> </em></strong></p><p><strong><em> #@realOY = -(Graphics.height - @trim), which I don't understand</em></strong></p><p><strong><em> #@bitmap_height = 384, -346, 384, -730, 384, -1114, 384, -1498, 384, -1882</em></strong></p><p><strong><em> #which I don't understand</em></strong></p><p><strong><em> #i = 0, then 1, 2, etc. up to 42 (iterates 42 times</em></strong></p><p><strong><em> #credit_sprite.oy = -346, -730, -1114, etc., and this happens 42 times,</em></strong></p><p><strong><em> #once per bitmap created</em></strong></p><p><strong><em> credit_sprite.oy = @realOY - @bitmap_height * i</em></strong></p><p><strong><em> #print "Credit sprite oy is " + credit_sprite.oy.to_s</em></strong></p><p><strong><em> #contributor_sprite.oy = @realOY - @bitmap_height * i</em></strong></p><p><strong><em> #@credit_sprites is blank. Is this an image?</em></strong></p><p><strong><em> #i is the bitmap, the block of text</em></strong></p><p><strong><em> #@credit_sprites bitmap 0 (first bitmap) is credit_sprite, which is put on</em></strong></p><p><strong><em> #the @text_viewport</em></strong></p><p><strong><em> @credit_sprites = credit_sprite</em></strong></p><p><strong><em> #@contributor_sprites = contributor_sprite</em></strong></p><p><strong><em> #credit_sprite is an image, a sprite</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em></em></strong></p><p><strong><em> </em></strong></p><p><strong><em> </em></strong></p><p><strong><em> </em></strong></p><p><strong><em></em></strong></p><p><strong><em> </em></strong></p><p><strong><em> #-------------------------------</em></strong></p><p><strong><em> # Setup</em></strong></p><p><strong><em> #-------------------------------</em></strong></p><p><strong><em> # Stops all audio but background music</em></strong></p><p><strong><em> previousBGM = $game_system.getPlayingBGM</em></strong></p><p><strong><em> pbMEStop</em></strong></p><p><strong><em> pbBGSStop</em></strong></p><p><strong><em> pbSEStop</em></strong></p><p><strong><em> pbBGMFade(2.0)</em></strong></p><p><strong><em> pbBGMPlay(BGM)</em></strong></p><p><strong><em> Graphics.transition(20)</em></strong></p><p><strong><em> while @creditsEnd != 1</em></strong></p><p><strong><em> Graphics.update</em></strong></p><p><strong><em> Input.update</em></strong></p><p><strong><em> update</em></strong></p><p><strong><em> pbUpdateSceneMap</em></strong></p><p><strong><em> break if $scene != self</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em> pbBGMFade(2.0)</em></strong></p><p><strong><em> Graphics.freeze</em></strong></p><p><strong><em> Graphics.transition(20, "fadetoblack")</em></strong></p><p><strong><em> @background_sprite.dispose</em></strong></p><p><strong><em> @credit_sprites.each { |s| s.dispose if s }</em></strong></p><p><strong><em> @contributor_sprites.each { |s| s[1].dispose if s[1] }</em></strong></p><p><strong><em> @text_viewport.dispose</em></strong></p><p><strong><em> $PokemonGlobal.creditsPlayed = true</em></strong></p><p><strong><em> pbBGMPlay(previousBGM)</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em></em></strong></p><p><strong><em> </em></strong></p><p><strong><em> </em></strong></p><p><strong><em> </em></strong></p><p><strong><em> # Check if the credits should be cancelled</em></strong></p><p><strong><em> def cancel?</em></strong></p><p><strong><em> if Input.trigger?(Input::USE) && $PokemonGlobal.creditsPlayed</em></strong></p><p><strong><em> $scene = Scene_Map.new</em></strong></p><p><strong><em> pbBGMFade(1.0)</em></strong></p><p><strong><em> return true</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em> return false</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em></em></strong></p><p><strong><em> # Checks if credits bitmap has reached its ending point</em></strong></p><p><strong><em> def last?</em></strong></p><p><strong><em> if @realOY > @total_height + @trim</em></strong></p><p><strong><em> $scene = ($game_map) ? Scene_Map.new : nil</em></strong></p><p><strong><em> @creditsEnd = 1</em></strong></p><p><strong><em> pbBGMFade(2.0)</em></strong></p><p><strong><em> return true</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em> return false</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em></em></strong></p><p><strong><em> def update</em></strong></p><p><strong><em> delta = Graphics.delta_s</em></strong></p><p><strong><em> @counter += delta</em></strong></p><p><strong><em> # Go to next slide</em></strong></p><p><strong><em> if @counter >= SECONDS_PER_BACKGROUND</em></strong></p><p><strong><em> @counter -= SECONDS_PER_BACKGROUND</em></strong></p><p><strong><em> @bg_index += 1</em></strong></p><p><strong><em> @bg_index = 0 if @bg_index >= BACKGROUNDS_LIST.length</em></strong></p><p><strong><em> @background_sprite.setBitmap("Graphics/Titles/" + BACKGROUNDS_LIST[@bg_index])</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em> return if cancel?</em></strong></p><p><strong><em> return if last?</em></strong></p><p><strong><em> @realOY += SCROLL_SPEED * delta</em></strong></p><p><strong><em> # s is the sprite, i is the index</em></strong></p><p><strong><em> @credit_sprites.each_with_index { |s, i| s.oy = @realOY - @bitmap_height * i }</em></strong></p><p><strong><em> </em></strong></p><p><strong><em> # a is an array with the name of the contributor and the sprite</em></strong></p><p><strong><em> # a[1] is the first sprite, then it's the second sprite, and so on in a loop</em></strong></p><p><strong><em> #until the credits end</em></strong></p><p><strong><em> #realOY starts just off-screen, so it starts around -300 something</em></strong></p><p><strong><em> #as graphics update, the realOY becomes more positive, so the sprites scroll</em></strong></p><p><strong><em> #upwards</em></strong></p><p><strong><em> @contributor_sprites.each_with_index { |a, i|</em></strong></p><p><strong><em> a[1].oy = @realOY - a[1].y</em></strong></p><p><strong><em> #print a[1].oy.to_s</em></strong></p><p><strong><em> }</em></strong></p><p><strong><em> end</em></strong></p><p><strong><em></em></strong></p><p><strong><em> </em></strong></p><p><strong><em> #end of class</em></strong></p><p><strong><em>end</em></strong></p><p><em>=====================================================================================================</em></p><p>[/SPOILER]</p><p>I tried printing the .oy of each picture, and the first picture's .oy is at @realOY minus 0, which is correct. The second picture's .oy is at @realOY minus 32, which is also correct! So why is there a 32 pixel gap between the icons?</p><p></p><p>Can anybody assist?</p></blockquote><p></p>
[QUOTE="Gardenette, post: 43433, member: 13256"] I need some help with my custom credits script. What I'm trying to accomplish: I want a custom icon to appear next to specific people's names. If there exists a file in Graphics/Pictures/Credits/person's name, I want to put that icon next to their name. Here is my problem: When I run the credits, the first file aligns perfectly. The second file is not at the same height as the name Gardenette, and it only gets worse as it goes on. Here is a picture. [ATTACH type="full" alt="1662139161031.png"]12356[/ATTACH] The image of 4 red arrows should appear next to Saltilton, which it does. The image of the player head should appear next to Gardenette, and it appears 32 pixels lower than it should. Both images are 32x32. [ATTACH type="full" alt="1662139258438.png"]12357[/ATTACH] [ATTACH type="full" alt="1662139280509.png"]12358[/ATTACH] [ATTACH type="full" alt="1662139306776.png"]12359[/ATTACH] Here is the code: [SPOILER] ===================================================================================================== [B]#============================================================================== # * Scene_Credits #------------------------------------------------------------------------------ # Scrolls the credits you make below. Original Author unknown. # ## Edited by MiDas Mike so it doesn't play over the Title, but runs by calling # the following: # $scene = Scene_Credits.new # ## New Edit 3/6/2007 11:14 PM by AvatarMonkeyKirby. # Ok, what I've done is changed the part of the script that was supposed to make # the credits automatically end so that way they actually end! Yes, they will # actually end when the credits are finished! So, that will make the people you # should give credit to now is: Unknown, MiDas Mike, and AvatarMonkeyKirby. # -sincerly yours, # Your Beloved # Oh yea, and I also added a line of code that fades out the BGM so it fades # sooner and smoother. # ## New Edit 24/1/2012 by Maruno. # Added the ability to split a line into two halves with <s>, with each half # aligned towards the centre. Please also credit me if used. # ## New Edit 22/2/2012 by Maruno. # Credits now scroll properly when played with a zoom factor of 0.5. Music can # now be defined. Credits can't be skipped during their first play. # ## New Edit 25/3/2020 by Maruno. # Scroll speed is now independent of frame rate. Now supports non-integer values # for SCROLL_SPEED. # ## New Edit 21/8/2020 by Marin. # Now automatically inserts the credits from the plugins that have been # registered through the PluginManager module. #============================================================================== class Scene_Credits # Backgrounds to show in credits. Found in Graphics/Titles/ folder BACKGROUNDS_LIST = ["credits1", "credits2", "credits3", "credits4", "credits5"] BGM = "Credits" SCROLL_SPEED = 190 # Pixels per second, was 40 SECONDS_PER_BACKGROUND = 11 TEXT_OUTLINE_COLOR = Color.new(0, 0, 128, 255) TEXT_BASE_COLOR = Color.new(255, 255, 255, 255) TEXT_SHADOW_COLOR = Color.new(0, 0, 0, 100) # This next piece of code is the credits. # Start Editing CREDIT = <<[I]END[/I] Saltilton Gardenette Scripts & Coding ---------------- Advanced Map Transfers: Luka S.J. Always in Bushes: Kotaro KleinStudio Ambient Pokémon Cries: Vendily SpaceWestern Astralneko's Scripting Utilities: Astralneko Bag Screen with Interactable Party: DiegoWT Rose Vendily Better Region Map: Marin Boonzeet New DexNav: Phantombass suzerain NuriYuri raZ Vendily Savordez Marin Zaffre ThatWelshOne_ DiegoWT's Starter Selection: DiegoWT DPPT Gender Selector Scene: A.Somersault Easy Text Skip: Amethyst Kurotsune ENLS Easy Mouse System: Luka S.J. Evolve from Party: IndianAnimator eriedaberrie#1569 EVs and IVs in Summary: Deoxysprime Following Pokémon EX: Golisopod User Help-14 zingzags Rayd12smitty Venom12 mej71 PurpleZaffre Akizakura16 Thundaga Armin Maruno Item Find: Boonzeet Location Signposts: LostSoulsDev carmaniac PurpleZaffre Golisopod User Luka's Scripting Utilities: Luka S.J. Marin's Scripting Utilities: Marin Modern Quest System + UI: ThatWelshOne_ mej71 derFischae Marin Overworld Shadows EX: Golisopod User Wolf PP Marin Monitor Icons: Ulithium_Dragon bo4p5687 ThatWelshOne_ raZ Marin Maruno Nuri Yuri PurpleZaffre Savordez Vendily SpaceWestern Gardenette Pokémon Amie: PizzaSun rigbycwts BhagyaJyoti Luka S.J bo4p5687 Quicksave: Low Speed Up 2.0: Marin Phantombass Video with Using Gif: bo4p5687 Voltseon's A-Star Pathfinding: Voltseon Golisopod User ENLS Voltseon's Pause Menu: Voltseon Golisopod User ENLS Graphics -------- Tilesets: Tyler Jones - Environmental Designer GreenJellybean ventesthefloof Griffin L Kaloja Saltilton Aveon Trainer Derlo King Tapia Magiscarf Princess Phoenix Donlawride aball Cristata Groogey ShadySheep the.sizzlepanda Rider Dragon Pokémon & Pokédex: Jack Claire Evelyn315 Akikaze Firedude LuckyBenjamin the Appletun Loretze Applesaucior farbol234 SoundJack426 8xviktor ventesthefloof RockTomb Ian (The Picky Pixel Artist) Saltilton theWaterleaf Soda Lorka_Grey KameOtaku Dan Bacon MillerMiller Cristata I’m Para Jeremy K Hub-Bub Master_Machi Pelican Bean Soup A Happi Rapter aball Bee Chespin (Ethan) Chromatech01 Eshan Fikolyte Floriak gribbin Grimrose Igor! MarsTemple Regal-Turtwig ShadySheep SietseML Solvaa SomeAllay WillTheWall Trainers/NPCs: Jack Claire Loretze ventesthefloof RockTomb Saltilton HingisDingus Chespin (Ethan) Akikaze KameOtaku Gardenette Zacharie MillerMiller Bee TheRoyalDex MILKMAN UI & Misc.: Random Talking Bush aball Adam Dan Bacon Basalte HwiteHwale MillerMiller Gardenette MANGO MarsTemple Riot Master_Machi Chespin (Ethan) Jackster Saltilton Music ----- Soundtrack: Rhythm Break ReMX Bossa Nova Pokémon Cries: Gardenette Text 206 Mapping ------- stygma ImaDeadMan Gardenette Kaloja GreenJellybean MANGO RISH Shadows Eventing -------- Low SpaceWestern stygma Gardenette Story & Quests -------------- Angel BlueLightning Firedude Kyl-E Gardenette ThisGrainCharacter (Gluten Free) DeinoNuggies HwiteHwale Krabby Enthusiast Luc_ Shilo sneakysnek Game Data & Balancing --------------------- Malarkey3072 Kyl-E Low SpaceWestern stygma Gardenette MacheteMcGoo noahthenumbat DomTom <3 w <3 Adam caesar Empyrean Garreon Hare64 HwiteHwale MarsTemple Midbus mSilk Robochef9000 Señor Gallo de Caballo Shadows Waffler Zyuran Translating ----------- Blind guy,i guess Fitch Basalte Floriak Hey Truegear Wowo Playtesting ----------- Chespin (Ethan) ventesthefloof BlueLightning Saltilton Blind guy,i guess Jamadxx Team Organization ----------------- stygma Katie HingisDingus Gardenette Master_Machi Bee Luc_ MarsTemple Firedude Mazah Region Created by ----------------------- Subjectively Jack Claire Special Thanks -------------- "Pokémon Essentials" was created by: Flameguru Poccil (Peter O.) Maruno With contributions from: AvatarMonkeyKirby Marin Boushy MiDas Mike Brother1440 Near Fantastica FL. PinkMan Genzai Kawakami Popper Golisopod User Rataime help-14 Savordez IceGod64 SoundSpawn Jacob O. Wobbrock the__end KitsuneKouta Venom12 Lisa Anthony Wachunga Luka S.J. Derxwna Kapsyla and everyone else who helped out "mkxp-z" by: Roza Based on MKXP by Ancurio et al. "RPG Maker XP" by: Enterbrain Pokémon is owned by: The Pokémon Company Nintendo Affiliated with Game Freak This is a non-profit fan-made game. No copyright infringements intended. Please support the official games! {INSERTS_PLUGIN_CREDITS_DO_NOT_REMOVE} [I]END[/I] # Stop Editing def main @creditsEnd = 0 #------------------------------- # Animated Background Setup #------------------------------- @counter = 0.0 # Counts time elapsed since the background image changed @bg_index = 0 @bitmap_height = Graphics.height # For a single credits text bitmap @trim = Graphics.height / 10 # Number of game frames per background frame @realOY = -(Graphics.height - @trim) #------------------------------- # Credits text Setup #------------------------------- plugin_credits = "" PluginManager.plugins.each do |plugin| pcred = PluginManager.credits(plugin) CREDIT.gsub!(/\{INSERTS_PLUGIN_CREDITS_DO_NOT_REMOVE\}/, plugin_credits) @credit_lines = CREDIT.split(/\n/) plugin_credits << "\"#{plugin}\" v.#{PluginManager.version(plugin)} by:\n" if pcred.size >= 5 plugin_credits << pcred[0] + "\n" i = 1 until i >= pcred.size plugin_credits << pcred[I] + "<s>" + (pcred[i + 1] || "") + "\n" i += 2 end else pcred.each { |name| plugin_credits << name + "\n" } end plugin_credits << "\n" end #------------------------------- # Make background and text sprites #------------------------------- @text_viewport = Viewport.new(0, @trim, Graphics.width, Graphics.height - (@trim * 2)) @text_viewport.z = 99999 @background_sprite = IconSprite.new(0, 0) @background_sprite.setBitmap("Graphics/Titles/" + BACKGROUNDS_LIST[0]) @background_sprite.opacity = 0 @credit_sprites = [] @contributor_sprites = {} @total_height = @credit_lines.size * 32 lines_per_bitmap = @bitmap_height / 32 num_bitmaps = (@credit_lines.size.to_f / lines_per_bitmap).ceil #there are 42 bitmaps right now, so for i in 0...42 (iterate 42 times) for i in 0...num_bitmaps #the width and height match the size of the screen credit_bitmap = Bitmap.new(Graphics.width, @bitmap_height) #Sets a bitmap's font to the system font. pbSetSystemFont(credit_bitmap) #j is the iteration letter #lines_per_bitmap is 12 #so for j in 0...12 (12 times), but it goes more than 12 times for j in 0...lines_per_bitmap #line = blank. The first line in the credits #@credit_lines = the entire credits all in one array #i = 0, since this is the first iteration #lines_per_bitmap = 12 #j = 0, the first iteration, then 1, 2, all the way to 11 #(12 iterations) #so it's #line = @credit_lines array, position [0 * 12 + 0] = @credit_lines[0] line = @credit_lines[i * lines_per_bitmap + j] next if !line #if the line is not empty as in has no value and we've reached the end? #split the line when you find a <s> line = line.split("<s>") xpos = 0 align = 1 # Centre align linewidth = Graphics.width #k is the iteration letter #line.length is 0 if the line is empty and 1 if there is anything on the #line for k in 0...line.length #so for k in 0...line.length (2 times?) #k is just 0 over and over if line.length > 1 #I have no idea what's going on here. Something about alignment xpos = (k == 0) ? 0 : 20 + Graphics.width / 2 align = (k == 0) ? 2 : 0 # Right align : left align linewidth = Graphics.width / 2 - 20 end #change the font color of text put on the bitmap credit_bitmap.font.color = TEXT_SHADOW_COLOR #draw the shadow of the text on the bitmap #xpos = 0 over and over #y is j*32+8, which comes out to 40, 72, 104, 136, etc and eventually #loops back to 0 if it passes the screen height. The +8 is just for #the shadow. #so draw_text(x = 0, y = 0, width = linewidth, height = 32, what to #draw is the contents of line[k] so "Scripts & Coding" which is the #first line in the credits, alignment) credit_bitmap.draw_text(xpos, j * 32 + 8, linewidth, 32, line[k], align) credit_bitmap.font.color = TEXT_OUTLINE_COLOR credit_bitmap.draw_text(xpos + 2, j * 32 - 2, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos, j * 32 - 2, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos - 2, j * 32 - 2, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos + 2, j * 32, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos - 2, j * 32, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos + 2, j * 32 + 2, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos, j * 32 + 2, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos - 2, j * 32 + 2, linewidth, 32, line[k], align) credit_bitmap.font.color = TEXT_BASE_COLOR #draw the contents of line[k] to the bitmap #j is 0...12 and goes (12 times). It's the number of lines per the #bitmap #j*32 is 32,64,96,128,192,224,256,320,0,64,96,160,192,224,256,320,352, #0,etc. #it seems the bitmap's height is 352. Once the y reaches 352, the next #bit of text's y starts at 0 or whatever is leftover when going over #352 credit_bitmap.draw_text(xpos, j * 32, linewidth, 32, line[k], align) #I need to check if the contents of line[k] exist as a file in #pictures/credits, and it if does, put it at height j*32 in this loop #that should put the graphic in the correct spot next to the name #but for now I will check if line[k] equals a specific string and if #it does, I will place a sprite at j*32 on this bitmap name = line[k].to_s if FileTest.image_exist?("Graphics/Pictures/Credits/" + name) #create a new sprite for line[k] @contributor_sprites[name+"-#{i}-#{j}"] = Sprite.new(@text_viewport) #make the sprite a bitmap @contributor_sprites[name+"-#{i}-#{j}"].bitmap = Bitmap.new("Graphics/Pictures/Credits/" + name) #set the x of that bitmap sprite (the person's graphic) @contributor_sprites[name+"-#{i}-#{j}"].x = 0 #set the y of that bitmap sprite (the person's graphic) #j * 32 is the height the name appears at on this bitmap, whether it's #0,32,64, etc. name_height = j * 32 @contributor_sprites[name+"-#{i}-#{j}"].y = name_height + @bitmap_height * i #print name+"-#{i}-#{j}" #print name + ".y is " + @contributor_sprites[name].y.to_s end end end #all this below is in the for i loop #put all the bitmaps together credit_sprite = Sprite.new(@text_viewport) credit_sprite.bitmap = credit_bitmap credit_sprite.z = 9998 #create the long bitmap for the contributor sprites =begin contributor_sprite = Sprite.new(@cont_viewport) contributor_sprite.bitmap = credit_bitmap contributor_sprite.z = 9997 =end #@realOY = -(Graphics.height - @trim), which I don't understand #@bitmap_height = 384, -346, 384, -730, 384, -1114, 384, -1498, 384, -1882 #which I don't understand #i = 0, then 1, 2, etc. up to 42 (iterates 42 times #credit_sprite.oy = -346, -730, -1114, etc., and this happens 42 times, #once per bitmap created credit_sprite.oy = @realOY - @bitmap_height * i #print "Credit sprite oy is " + credit_sprite.oy.to_s #contributor_sprite.oy = @realOY - @bitmap_height * i #@credit_sprites is blank. Is this an image? #i is the bitmap, the block of text #@credit_sprites bitmap 0 (first bitmap) is credit_sprite, which is put on #the @text_viewport @credit_sprites = credit_sprite #@contributor_sprites = contributor_sprite #credit_sprite is an image, a sprite end #------------------------------- # Setup #------------------------------- # Stops all audio but background music previousBGM = $game_system.getPlayingBGM pbMEStop pbBGSStop pbSEStop pbBGMFade(2.0) pbBGMPlay(BGM) Graphics.transition(20) while @creditsEnd != 1 Graphics.update Input.update update pbUpdateSceneMap break if $scene != self end pbBGMFade(2.0) Graphics.freeze Graphics.transition(20, "fadetoblack") @background_sprite.dispose @credit_sprites.each { |s| s.dispose if s } @contributor_sprites.each { |s| s[1].dispose if s[1] } @text_viewport.dispose $PokemonGlobal.creditsPlayed = true pbBGMPlay(previousBGM) end # Check if the credits should be cancelled def cancel? if Input.trigger?(Input::USE) && $PokemonGlobal.creditsPlayed $scene = Scene_Map.new pbBGMFade(1.0) return true end return false end # Checks if credits bitmap has reached its ending point def last? if @realOY > @total_height + @trim $scene = ($game_map) ? Scene_Map.new : nil @creditsEnd = 1 pbBGMFade(2.0) return true end return false end def update delta = Graphics.delta_s @counter += delta # Go to next slide if @counter >= SECONDS_PER_BACKGROUND @counter -= SECONDS_PER_BACKGROUND @bg_index += 1 @bg_index = 0 if @bg_index >= BACKGROUNDS_LIST.length @background_sprite.setBitmap("Graphics/Titles/" + BACKGROUNDS_LIST[@bg_index]) end return if cancel? return if last? @realOY += SCROLL_SPEED * delta # s is the sprite, i is the index @credit_sprites.each_with_index { |s, i| s.oy = @realOY - @bitmap_height * i } # a is an array with the name of the contributor and the sprite # a[1] is the first sprite, then it's the second sprite, and so on in a loop #until the credits end #realOY starts just off-screen, so it starts around -300 something #as graphics update, the realOY becomes more positive, so the sprites scroll #upwards @contributor_sprites.each_with_index { |a, i| a[1].oy = @realOY - a[1].y #print a[1].oy.to_s } end #end of class end[/I][/B] [I]=====================================================================================================[/I] [/SPOILER] I tried printing the .oy of each picture, and the first picture's .oy is at @realOY minus 0, which is correct. The second picture's .oy is at @realOY minus 32, which is also correct! So why is there a 32 pixel gap between the icons? Can anybody assist? [/QUOTE]
Insert quotes…
Verification
What's the name of the yellow mouse that is the most popular Pokémon?
Post reply
Forums
Pokémon Essentials
Questions
Help with Custom Credits
Top