Override background

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3596
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Override background

#1

Post by Lobby »

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 1861 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 1861 times
This sample replaces the background with a black one:
frames.png
frames.png (381 Bytes) Viewed 1861 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 44 times
own_background.zip
(1.58 KiB) Downloaded 72 times
=^._.^= ∫

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

Platform

Re: [383]Override background

#2

Post by mdk_813 »

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

Update Sep 12, 2020:
As I am not really active here anymore, I am not able to answer any PMs in time.
So, as long as you mention me in the plugin and the description, feel free to use or modify my plugins for your own creations.

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2056
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Contact:

Platform

Plugin Creator

Re: [383]Override background

#3

Post by KINGTUT10101 »

Is it possible to have multiple frames for the background?

User avatar
Lobby
Developer
Reactions:
Posts: 3596
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Re: [383]Override background

#4

Post by Lobby »

no
=^._.^= ∫

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

Re: [383]Override background

#5

Post by BruceWillis24 »

@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!

User avatar
CommanderABab
AB
Reactions:
Posts: 8837
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: [383]Override background

#6

Post by CommanderABab »

There it is!  :)
There it is! :)
Image

User avatar
Bearbear76
Former Bearbear65
Reactions:
Posts: 5296
Joined: Fri Feb 10, 2017 14:53
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: [383]Override background

#7

Post by Bearbear76 »

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

User avatar
Lobby
Developer
Reactions:
Posts: 3596
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Re: [383]Override background

#8

Post by Lobby »

Yes, you can do that everywhere where you have to provide frames :)
=^._.^= ∫

User avatar
Bearbear76
Former Bearbear65
Reactions:
Posts: 5296
Joined: Fri Feb 10, 2017 14:53
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: [383]Override background

#9

Post by Bearbear76 »

IMG_20171226_085022.jpg
ImageJust my opinion

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”