Thread: sprites for small darker frame on interface

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 sprites for small darker frame on interface 
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Hello,
    I've seen some people releasing interfaces with this darker small frame on them.
    Attached image
    Attached image
    Attached image
    Does anyone have the sprites to compose these frames?
    Reply With Quote  
     

  2. #2  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Bump
    Reply With Quote  
     

  3. #3  
    Registered Member
    rebecca's Avatar
    Join Date
    Aug 2017
    Posts
    1,071
    Thanks given
    862
    Thanks received
    915
    Rep Power
    5000
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Renown Programmer
    Greg's Avatar
    Join Date
    Jun 2010
    Posts
    1,179
    Thanks given
    260
    Thanks received
    1,012
    Rep Power
    2003
    Quote Originally Posted by Rememberm3 View Post
    Hello,
    I've seen some people releasing interfaces with this darker small frame on them.
    Attached image
    Attached image
    Attached image
    Does anyone have the sprites to compose these frames?
    Trick question, they're not sprites.

    Code:
    public static void fillRectangle(int drawX, int drawY, int width, int height, int colour, int alpha) {
            if (drawX < clipLeft) {
                width -= clipLeft - drawX;
                drawX = clipLeft;
            }
    
            if (drawY < clipTop) {
                height -= clipTop - drawY;
                drawY = clipTop;
            }
    
            if (drawX + width > clipRight)
                width = clipRight - drawX;
    
            if (drawY + height > clipBottom)
                height = clipBottom - drawY;
    
            int inverseAlpha = 256 - alpha;
            int r = (colour >> 16 & 0xff) * alpha;
            int g = (colour >> 8 & 0xff) * alpha;
            int b = (colour & 0xff) * alpha;
            int dx = Raster.width - width;
            int pixel = drawX + drawY * Raster.width;
    
            for (int x = 0; x < height; x++) {
                for (int y = -width; y < 0; y++) {
                    int r2 = (raster[pixel] >> 16 & 0xff) * inverseAlpha;
                    int g2 = (raster[pixel] >> 8 & 0xff) * inverseAlpha;
                    int b2 = (raster[pixel] & 0xff) * inverseAlpha;
                    raster[pixel++] = (r + r2 >> 8 << 16) + (g + g2 >> 8 << 8) + (b + b2 >> 8);
                }
    
                pixel += dx;
            }
        }
    Attached imageAttached image
    Reply With Quote  
     

  6. Thankful users:


  7. #5  
    Registered Member
    rebecca's Avatar
    Join Date
    Aug 2017
    Posts
    1,071
    Thanks given
    862
    Thanks received
    915
    Rep Power
    5000
    thats true i didnt think of that, but still could use it for scaling different sprites if he wants to use some other ones
    Reply With Quote  
     

  8. Thankful user:


  9. #6  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    This is really helpful if I want to step up my interface game. I will use this. Thank you!

    Quote Originally Posted by Greg View Post
    Trick question, they're not sprites.

    Code:
    public static void fillRectangle(int drawX, int drawY, int width, int height, int colour, int alpha) {
            if (drawX < clipLeft) {
                width -= clipLeft - drawX;
                drawX = clipLeft;
            }
    
            if (drawY < clipTop) {
                height -= clipTop - drawY;
                drawY = clipTop;
            }
    
            if (drawX + width > clipRight)
                width = clipRight - drawX;
    
            if (drawY + height > clipBottom)
                height = clipBottom - drawY;
    
            int inverseAlpha = 256 - alpha;
            int r = (colour >> 16 & 0xff) * alpha;
            int g = (colour >> 8 & 0xff) * alpha;
            int b = (colour & 0xff) * alpha;
            int dx = Raster.width - width;
            int pixel = drawX + drawY * Raster.width;
    
            for (int x = 0; x < height; x++) {
                for (int y = -width; y < 0; y++) {
                    int r2 = (raster[pixel] >> 16 & 0xff) * inverseAlpha;
                    int g2 = (raster[pixel] >> 8 & 0xff) * inverseAlpha;
                    int b2 = (raster[pixel] & 0xff) * inverseAlpha;
                    raster[pixel++] = (r + r2 >> 8 << 16) + (g + g2 >> 8 << 8) + (b + b2 >> 8);
                }
    
                pixel += dx;
            }
        }
    I haven’t thought of it as being just code, because people were releasing interfaces with these frames already on them, which I think is weird when you can just use a small snippet.

    Quote Originally Posted by Expand View Post
    thats true i didnt think of that, but still could use it for scaling different sprites if he wants to use some other ones
    Exactly!
    Reply With Quote  
     

  10. #7  
    Registered Member
    rebecca's Avatar
    Join Date
    Aug 2017
    Posts
    1,071
    Thanks given
    862
    Thanks received
    915
    Rep Power
    5000
    Greg is still technically right you can define a new widget type u can use for these rectangles, but 9 patch really is helpful for unlimited sizes
    Reply With Quote  
     

  11. Thankful user:


  12. #8  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Expand View Post
    Greg is still technically right you can define a new widget type u can use for these rectangles, but 9 patch really is helpful for unlimited sizes
    Yeah exactly, I might use both. Then I still don’t understand how they release these with the frames, like did they screenshot them or something. That’d be very poor


    Verzonden vanaf mijn iPhone met Tapatalk
    Attached image
    Reply With Quote  
     

  13. #9  
    Renown Programmer
    Greg's Avatar
    Join Date
    Jun 2010
    Posts
    1,179
    Thanks given
    260
    Thanks received
    1,012
    Rep Power
    2003
    Quote Originally Posted by Rememberm3 View Post
    Yeah exactly, I might use both. Then I still don’t understand how they release these with the frames, like did they screenshot them or something. That’d be very poor
    If your talking about having them already on the background sprite then they most likely use photoshop. But using lots of large sprites will increase client ram usage significantly, especially as 317 client's hold interfaces and sprites in ram at all times. Backgrounds are tillable and should be drawn using 9-patch like Expanded said, the single colour rectangles should be drawn using the rectangle methods (in all raster classes) one larger filled rectangle and an outline rectangle 2 pixels smaller will get the look you're looking for.
    Attached imageAttached image
    Reply With Quote  
     

  14. #10  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Greg View Post
    If your talking about having them already on the background sprite then they most likely use photoshop. But using lots of large sprites will increase client ram usage significantly, especially as 317 client's hold interfaces and sprites in ram at all times. Backgrounds are tillable and should be drawn using 9-patch like Expanded said, the single colour rectangles should be drawn using the rectangle methods (in all raster classes) one larger filled rectangle and an outline rectangle 2 pixels smaller will get the look you're looking for.
    Okay, that’s useful information, I’ll try to use as few images as possible. Some days ago I did a tutorial for only loading sprites when they’re needed. I don’t think they’re unloaded when you’re not using them anymore, but this should cut quite some usage. So that’s always nice to have


    Verzonden vanaf mijn iPhone met Tapatalk
    Attached image
    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. Sprites fading in and out on interfaces
    By 3lv3n snip3r in forum Help
    Replies: 1
    Last Post: 08-29-2012, 03:42 AM
  2. [525] Dialog frames + item on interface
    By Edu in forum Snippets
    Replies: 19
    Last Post: 09-02-2009, 10:33 AM
  3. Replies: 4
    Last Post: 06-06-2009, 11:36 PM
  4. What item on interfaces and frames havent we got for 508
    By peterbjornx in forum RS 503+ Client & Server
    Replies: 32
    Last Post: 03-13-2009, 09:06 PM
  5. How to dump Child Id's for Items on interfaces
    By Hotyute in forum Tutorials
    Replies: 16
    Last Post: 02-22-2009, 03:46 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •