GithubHelp home page GithubHelp logo

yard1 / hoi4-scripted-gui-pie-chart Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 2.0 19 KB

An example way of how to implement a Scripted GUI pie chart in Hearts of Iron IV.

hearts-of-iron-4 heartsofiron4 hearts-of-iron-iv paradox-interactive paradoxgame modding pie-chart modding-resources

hoi4-scripted-gui-pie-chart's Introduction

HoI4-Scripted-GUI-Pie-Chart

An example way of how to implement a Scripted GUI pie chart in Hearts of Iron 4.

Showcase GIF

A pie segment iconType equivalent to a 1/100 of the entire pie is created 100 times, each time with a 3.6 degree rotation, creating a full pie in the end. The texture contains frames - and which frame is shown is controlled by a 100 element pie_chart array, with each element corresponding to an iconType. The create_pie_chart scripted effect is used to create the pie_chart array, updating the pie chart. In this example, it is called daily.

The pie chart can be easily resized with scale argument in the .gui file. Changing the number of possible colors is also easy - one just needs to add/remove frames from the gfx/interface/pie_chart_segment.dds texture, and update the .gfx entry and the create_pie_chart scripted effect. This pie chart can be used to represent any values adding up to 100% - in this example, vanilla party popularities are used.

You may overlay a pie chart overlay onto this pie chart, to make it look nicer.

Feel free to use in your mods, but give credits to Yard1 (both in code, with comments; and on your download page).

hoi4-scripted-gui-pie-chart's People

Contributors

yard1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

skullbe forktu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.