Override background

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3129
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Override background

Post by Lobby » Thu Nov 30, 2017 21:55

Screenshot_20171130-204326.png
Hi, as proposed here it's now possible to change the color of the background. The background basically persists out of a tile frame that's drawn over and over again. Unfortunately it's a bit less simple, as there are some special cases due to elevated coast lines. As a result you have to provide 3 frames to override the background:
frames_explain.png
frames_explain.png (1.95 KiB) Viewed 775 times
Frames b and c are used to draw the background above water at the edges. This is crucial as ocean is drawn everywhere and has to be overdrawn at the correct positions.

The the used original frames look like:
frames_orig.png
frames_orig.png (408 Bytes) Viewed 775 times
This sample replaces the background with a black one:
frames.png
frames.png (381 Bytes) Viewed 775 times
For your own background, just recolor this image :)

The code to override the background looks like:

Code: Select all

[
  {
    "override":true,
    "id":"$anim_blank00",
    "type":"animation",
    "frames":[
      {"bmp":"frames.png","w":32,"h":16,"handle y":8},
      {"bmp":"frames.png","x":32,"w":16,"h":16,"handle y":8},
      {"bmp":"frames.png","x":48,"w":16,"h":16,"handle x":-16,"handle y":8}
    ]
  }
]
As you might notice it is also responsible for setting the handles properly. I recommend to just reuse this code instead of writing it on your own.
Attachments
own_background.json
(307 Bytes) Downloaded 16 times
own_background.zip
(1.58 KiB) Downloaded 27 times
...Have a nice stay

User avatar
mdk_813
Inhabitant of a Country
Reactions:
Posts: 843
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

Re: [383]Override background

Post by mdk_813 » Thu Nov 30, 2017 22:15

@Lobby
Thank you! :thumbsup:
My Plugins: Link

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 1767
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Phone model: Moto Z Force Droid

Re: [383]Override background

Post by KINGTUT10101 » Fri Dec 01, 2017 2:01

Is it possible to have multiple frames for the background?

User avatar
Lobby
Developer
Reactions:
Posts: 3129
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Re: [383]Override background

Post by Lobby » Fri Dec 01, 2017 11:10

no
...Have a nice stay

BruceWillis24
Villager
Reactions:
Posts: 21
Joined: Sun Aug 09, 2015 0:42
Location: Grand Rapids Michigan
Plugins: Show
Version: Beta

Re: [383]Override background

Post by BruceWillis24 » Sun Dec 24, 2017 18:57

@Lobby I really like the brown background in the first image you posted in this topic. Could you post that as well?

Thank you in advance!

Online
User avatar
CommanderABab
Inhabitant of a Multiverse
Reactions:
Posts: 6414
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Re: [383]Override background

Post by CommanderABab » Sun Dec 24, 2017 19:23

Screenshot_20171224-115241.jpg
There it is! :)
524524Currently using alpha? 524. 524 What's new? :)
Lua!
:)

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

User avatar
Bearbear65
Inhabitant of a Universe
Reactions:
Posts: 4495
Joined: Fri Feb 10, 2017 14:53
Plugins: Show
Version: Beta
Phone model: ASUS ZenPad 10 z300c

Re: [383]Override background

Post by Bearbear65 » Tue Dec 26, 2017 1:45

You can change the background
In winter by using "frames winter":[{}],
Something i discovered yesterday
ImageJust my opinion
Caladrius is officially my favourite bird

User avatar
Lobby
Developer
Reactions:
Posts: 3129
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Re: [383]Override background

Post by Lobby » Tue Dec 26, 2017 1:45

Yes, you can do that everywhere where you have to provide frames :)
...Have a nice stay

User avatar
Bearbear65
Inhabitant of a Universe
Reactions:
Posts: 4495
Joined: Fri Feb 10, 2017 14:53
Plugins: Show
Version: Beta
Phone model: ASUS ZenPad 10 z300c

Re: [383]Override background

Post by Bearbear65 » Tue Dec 26, 2017 1:50

IMG_20171226_085022.jpg
ImageJust my opinion
Caladrius is officially my favourite bird

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”

Who is online

Users browsing this forum: No registered users and 0 guests