Thread: Custom Widget Builder (Kotlin)

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Custom Widget Builder (Kotlin) 
    Banned


    Join Date
    Jul 2020
    Posts
    157
    Thanks given
    100
    Thanks received
    166
    Rep Power
    0
    Hey so i saw a thread today that someone is making a custom Interface System based on Flutter so I thought ill show you all the system I made a few weeks back using Kotlin DSL, So i will show you what i have so far and a few interface samples please note I'm learning kotlin still so please post constructive feedback

    Why?

    Long Story short i hate how the 317 engine handles hard coded interfaces and how other people do it looks really ugly i think before you say Don't hardcode interfaces i like doing it a lot more just due to not having great tools and find it much faster (MY SYSTEM DOES ALLOW FOR PACKING THE INTERFACE FILE ALSO AND LOADING ON DEMAND)


    InterfaceBuilder:

    This contains basic information

    • Starting ID
    • List of children
    • Widget Type


    Spoiler for Code Exmaple:
    Attached image


    buildInterface:


    Build interface is the method that invokes the InterfaceBuilder and builds up the interface
    this has 6 basic parameters



    • ID - Starting ID of the interface
    • Interface Width - Width of the interface (Optional)
    • Interface Height - Height of the interface (Optional)
    • Center - This allows the programmer to center the interface based on the two above parameters them 3 are optional, this is nice for development so i can get the X and Y of the thing in the interface on Photoshop and put it in game and not have to worry about repositioning everything (Optional)
    • BuildFrame - If you want the frame to automatically build dynamically
    • HasClose - If the interface needs a close button


    Spoiler for Code Example:
    Attached image


    Components:

    Every single Component has 1 basic pram the Position the rest are defined individually for example

    Attached image

    They also have 1 extra function at the moment this allows you to add row/cols of Components very quick bu just calling this

    Code:
     buttons(SkillData.values().size,8,13,20) { 
                    normal { 29 }
                    hover { 27 }
                    position { Position(12,40) }
                }
    if you have a 's' in the method it acts like its a look and take a minimum of 2 parameters or 4 parameters but they are optional

    • How many you want in the loop
    • How many you want per row
    • PadX - Adds extra padding to the component if you don't have any extra padding it will use the size of the component + 1
    • PadY - Adds extra padding to the component if you don't have any extra padding it will use the size of the component + 1



    Current Components:

    Attached image

    Attached image

    Some Components as special things for example buttons will resize depending on the size and if u you want it dynamically built or you can use sprites, I do plan on adding a lot more Components and building on this system.

    Pros and Cons:

    Pros:
    - Really Quick to build interfaces
    - Nice and clean for other Developers to come in and look at
    - Can be Cache Packed and Loaded on demand
    - Lots of Features to allow for even the crappy of devs to make a interface with no sprite work
    - Tells you if the interface ID is taken already by some existing interface
    Cons:
    - not everyone knows kotlin
    - Hard to see components IDs like Item Containers working on a fix

    Thanks for reading i will be updating this post as and when i add new things here are some Examples of some working interfaces using this system

    Spoiler for Lamp Interface:


    Spoiler for Achievements:



    Credits:

    Thanks for the help from raccas and his moral support
    Reply With Quote  
     


  2. #2  
    The One And Only

    01053's Avatar
    Join Date
    Apr 2011
    Age
    28
    Posts
    2,887
    Thanks given
    417
    Thanks received
    885
    Rep Power
    856
    Looks good mate nice work.


    Reply With Quote  
     

  3. #3  
    ⚔️ Battle614 - Superiority ⚔️

    Battle614's Avatar
    Join Date
    Aug 2020
    Posts
    243
    Thanks given
    72
    Thanks received
    472
    Rep Power
    803
    Nice stuff

    Attached image
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Registered Member
    RuneList's Avatar
    Join Date
    May 2020
    Posts
    124
    Thanks given
    139
    Thanks received
    108
    Rep Power
    113
    Great work Mark!
    Reply With Quote  
     

  6. Thankful user:


  7. #5  
    DESIGNER

    Lynch's Avatar
    Join Date
    Feb 2016
    Age
    25
    Posts
    235
    Thanks given
    35
    Thanks received
    343
    Rep Power
    5000
    nice work.
    Reply With Quote  
     

  8. Thankful user:


  9. #6  
    Respected Member

    Revil's Avatar
    Join Date
    Nov 2010
    Age
    30
    Posts
    4,860
    Thanks given
    3,715
    Thanks received
    2,228
    Rep Power
    5000
    Very impressive work mate, keep it up!
    Reply With Quote  
     

  10. Thankful user:


  11. #7  
    Registered Member
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    26
    Posts
    5,103
    Thanks given
    1,818
    Thanks received
    1,767
    Rep Power
    2438
    People are starting to write top goat code more and more every day. Good job luxurious goat!
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Spoiler for skrrrrr:

    Attached image
    Reply With Quote  
     

  12. Thankful user:


  13. #8  
    Blurite

    Corey's Avatar
    Join Date
    Feb 2012
    Age
    26
    Posts
    1,491
    Thanks given
    1,245
    Thanks received
    1,729
    Rep Power
    5000
    good job, keep it up

    Quote Originally Posted by Mark_ View Post
    Attached image
    you may find it useful to declare Text.TextComponent.() -> Unit (and others) as a typealias
    also you spelt component wrong
    Attached image
    Reply With Quote  
     

  14. Thankful user:


  15. #9  
    Banned


    Join Date
    Jul 2020
    Posts
    157
    Thanks given
    100
    Thanks received
    166
    Rep Power
    0
    Quote Originally Posted by Corey View Post
    good job, keep it up


    you may find it useful to declare Text.TextComponent.() -> Unit (and others) as a typealias
    also you spelt component wrong
    Haha thanks for pointing that out was probably really late and I will look into typealias today
    Reply With Quote  
     

  16. #10  
    JavaScript Heathen 👹

    frostbit3's Avatar
    Join Date
    Mar 2012
    Age
    29
    Posts
    404
    Thanks given
    381
    Thanks received
    90
    Rep Power
    78
    This is really great Mark! I appreciate how much less verbose Kotlin is for writing these kinds of things. I'm too set in my ways (when it comes to the JVM) haha.
    >> real life is pretty much the same as code. off-by-one, naming, and unterminated recursion
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Custom Top List Rank Widget on IPS with PHP Block Widget
    By Justin___ in forum Website Development
    Replies: 1
    Last Post: 01-03-2018, 06:19 AM
  2. Custom Top List Rank Widget on IPS with PHP Block Widget
    By Justin___ in forum Website Development
    Replies: 0
    Last Post: 01-03-2018, 04:35 AM
  3. Custom Player Title's
    By Dune in forum Tutorials
    Replies: 43
    Last Post: 09-03-2007, 11:34 AM
  4. Tutorial Dirty Hack to Custom sprites
    By silabsoft in forum Tutorials
    Replies: 20
    Last Post: 04-27-2007, 12:07 AM
  5. RuneScape Buddy Builder
    By Eleclion in forum General
    Replies: 6
    Last Post: 04-02-2007, 12:33 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •