Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

OOP Style Paint/UI library

Featured Replies

Hey everyone, I'm not sure if this is the right forum but it was the closest I could find to what I'm about to ask,

 

I was about to get into creating scripts for osbot this time, and I remembered the last time I worked on something like this for another bot (which is more then 2 years ago) I was creating a small library to handle the creation of paints in an OOP way, with Swing in mind, although quite different. I did this because I really hated the default way to create those Paints/UIs in an onPaint method and this way you can create a panel, assign a background, add buttons with custom backgrounds etc. It will also be very organized as, for example, you can create separated classes for panels, you can add a click handler on a button instead of checking if it is in the bounds of a rectangle as I'm sure a lot of people are doing through the onPaint button atm.

 

I'm probably going to create something small like this for myself anyways, but if there's interest I may find some time to do this proper and release it. So please let me know what you think about this!

I've created a framework for this exact thing that I never bothered to finish. If you're interested I could drop you the source code and perhaps collaborate?

 

Message me if you're interested.

  • Author

I've created a framework for this exact thing that I never bothered to finish. If you're interested I could drop you the source code and perhaps collaborate?

 

Message me if you're interested.

Hey! Thanks for the response, however I already started working on this a few years back so I already had a little something to start with but it wouldn't hurt to collaborate on this though! How can I contact you?

Hey! Thanks for the response, however I already started working on this a few years back so I already had a little something to start with but it wouldn't hurt to collaborate on this though! How can I contact you?

pm him tongue.png

 

I do remember seeing a snippet back in OSB1, about a paint/gui thing pretty much what your explaining in the op. If you need any help or get stuck, you could always roam deep into the snippet sub-forum and maybe you could find that topic.

Edited by josedpay

  • Author

pm him tongue.png

 

I do remember seeing a snippet back in OSB1, about a paint/gui thing pretty much what your explaining in the op. If you need any help or get stuck, you could always roam deep into the snippet sub-forum and maybe you could find that topic.

I guess that's an option indeed :D

 

Thank you for pointing that out, I've just done a quick search in the snippet subforum but couldn't find what you meant. I did come across some tools to create paints (like a visual editor that generates the onPaint code) and I remember seeing someone who actually used swing to create a display for info :P but that's not what I'm working on now :p. It's coming along fine I think...I'm using many things from the hierachy of swing but everything is going to be absolute positions though (where the absolute positions of elements in containers are relative to their parent) which makes it ALOT easier for me to make.

 

The cool thing about a library like this is that you can for example easily implement drag support by adding a MouseMotionListener to the element that controls the dragging, in which you update the location of the Container that contains all elements you want to drag, and all the children in this container will move with the container aswell. Same thing with letting a button shine on hover, just implement a MouseHoverListener and change the backgroundcolor or image in there :P

I guess that's an option indeed :D

 

Thank you for pointing that out, I've just done a quick search in the snippet subforum but couldn't find what you meant. I did come across some tools to create paints (like a visual editor that generates the onPaint code) and I remember seeing someone who actually used swing to create a display for info :P but that's not what I'm working on now :p. It's coming along fine I think...I'm using many things from the hierachy of swing but everything is going to be absolute positions though (where the absolute positions of elements in containers are relative to their parent) which makes it ALOT easier for me to make.

 

The cool thing about a library like this is that you can for example easily implement drag support by adding a MouseMotionListener to the element that controls the dragging, in which you update the location of the Container that contains all elements you want to drag, and all the children in this container will move with the container aswell. Same thing with letting a button shine on hover, just implement a MouseHoverListener and change the backgroundcolor or image in there :P

Interesting I would like to see how it comes out once your done. I'll see if I could find that snippet later
  • Author

It took me a lot more time than I originally expected but I've finished the base of this thing. There's still lots to improve but I think it would already be nicer to work with compared to doing everything in the onPaint method. Anways, I'd like to create a seperate thread to post it but I'm not sure under which forum to do that, as it also looks like they've been changed today? Any suggestions?

 

EDIT

Nevermind, I've posted the release here: http://osbot.org/forum/topic/60807-java-jgtk-graphics2d-toolkit/?p=674407!

Edited by reveance

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.