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.

Basic JFrame animations

Featured Replies

I'm looking into making some simple JFrame animations:

3e6f051dad000ea48adcdc21059be276.gif

 

Going to make a few, make sure it's all nice and polished and clean and then release it on Github.

Goals:

  • Pulling/sliding in all directions (done left & right, have to do up & down now)
  • Alpha-based animations (fading in/out)
  • Size-based animations (shrinking/expanding)
  • Color-based animations (switching from color x to color y)

All of this will be based on JFrames, and I am originally building this for my GUIs.

 

"Alpha" animation:

43f2e37bc8aba87e0e4f01ebc6698d1c.gif

This actually uses linear interpolation (10% decrease each time) instead of actual transparency as this should reduce overall strain on the CPU.

Edited by Bobrocket

  • Author

inspired by the slayer gui i hope doge.png

Whatever helps you sleep at night :doge:

 

Looks neato.

 

However...

Alpha-based animations

Don't go there.

Your CPU will thank me.

They will be there should someone want to use them. Instead of drawing transparent colours, I could manually lerp each pixel by x%. That might take less CPU, albeit with different results.

it be like a phone app...on your computer :3 sounds good hope it works out for ya :D

  • Author

it be like a phone app...on your computer :3 sounds good hope it works out for ya biggrin.png

 

Thanks! Having frames like this not only allows for less confusion by the end user (eg "where is the rest of the info?"), it also ensures that users actually fill out everything and simplifies everything (meaning the user is not overwhelmed at first sight)

 

Working on color/"alpha" animations right now. Will post back soon.

I really really like this tbh, I would probably prefer G2D buttons instead of  the regular Swing ones (they look so 90s...), but I'm deffo going to give it a thorough look-through when I get some time ;)

  • Author

I really really like this tbh, I would probably prefer G2D buttons instead of  the regular Swing ones (they look so 90s...), but I'm deffo going to give it a thorough look-through when I get some time wink.png

 

I may port some of my .NET themes over to Java, we'll see ;)

  • Author

Some interesting debug information for the sliding animations:

1bfd137abcdce32b9e2fe01a8badeb0d.png

The red "circles" indicate where I clicked the "animate" button, which would perform the animation. In short, it uses copious amounts of CPU.

Why?

Currently, we use BufferedImage#getSubImage(x, y, width, height) to create each frame and then Graphics#drawImage(BufferedImage, x, y, ImageObserver) to draw it. Now, in a form of width 480, you're going to be creating 480 frames. This is obviously not going to be very CPU friendly.

 

The solution, I hear you begging for, is (somewhat) simple: reduce the frames, and make the thread sleep a little bit.

Now, this still uses a fair amount of CPU, however it does not use as much (and for as long)!

By utilising both frame reduction and thread sleeping, I can achieve the same smooth transition while keeping the CPU down a little bit.

9400ee8984a6c40a912baf9232bb5dcd.png

You can see here that the CPU spikes a lot less (we hit 100% consumption by spam clicking the animate button, whereas we top 40% now by spam clicking)

There's also practically no difference in the speed too:

02fd59e8060251afd43f2c8d12dc9c30.gif

 

Another thing to mention for this animation library is that you can chain effects (I can put an alpha/colour effect on a panel as well as have it pull left/right)

I'm looking into making some simple JFrame animations:

3e6f051dad000ea48adcdc21059be276.gif

 

Going to make a few, make sure it's all nice and polished and clean and then release it on Github.

Goals:

  • Pulling/sliding in all directions (done left & right, have to do up & down now)
  • Alpha-based animations (fading in/out)
  • Size-based animations (shrinking/expanding)
  • Color-based animations (switching from color x to color y)

All of this will be based on JFrames, and I am originally building this for my GUIs.

 

"Alpha" animation:

43f2e37bc8aba87e0e4f01ebc6698d1c.gif

This actually uses linear interpolation (10% decrease each time) instead of actual transparency as this should reduce overall strain on the CPU.

 

Why not use JavaFX instead of fuckugly Swing? It's been in the API for over and does the same thing plus way more.

  • Author

Why not use JavaFX instead of fuckugly Swing? It's been in the API for over and does the same thing plus way more.

 

stock-photo-happy-businessman-holding-hi

bald-man-thumbs-up-26364248.jpg

stock-photo-senior-business-man-showing-

Right as always, big guy.

Create an account or sign in to comment

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.