Raylib Tutorial | Episode 3 | Drawing textures and animating

Поділитися
Вставка
  • Опубліковано 16 лип 2024
  • In this episode we learn the difference between a texture and an image in raylib. We learn how to draw and even animate a texture.
    Got questions? got a project you want to show off? Join our discord server! / discord
    If you enjoy my content and want to support me I have a Patreon:
    www.patreon.com/user?u=3934312
  • Наука та технологія

КОМЕНТАРІ • 46

  • @piotao
    @piotao 2 місяці тому

    I've just found that and I'm happy to see. This helped me a lot with golang-ported library. Heh, and THAT feeling when you explain how to draw segmented textures on GPU and ALSO how modulo works at the same time... hihi
    Anyway, thank you! Such simple starter-grade tuts are very needed and very welcomed.

  • @joshuarowe8410
    @joshuarowe8410 4 роки тому +5

    Your keyboard sound is so satisfying haha.
    Awesome tutorial! I'm compiling raylib as we speak and excited to try this out.

  • @hashirsibtain
    @hashirsibtain 5 років тому +24

    Hey , I subbed. This is by far the best tutorial on raylib . I just want you to continue this Series. When are you uploading the fourth part ?

    • @SkyVaultGames
      @SkyVaultGames  5 років тому +9

      I'm glad you enjoyed it! Once I finish this commission work i'm doing Ill get right on the next episode, planning on making it about input.

  • @dabunnisher29
    @dabunnisher29 18 днів тому

    Really great explanation on how to do this.

  • @telepathictortoise3021
    @telepathictortoise3021 3 роки тому +1

    Really clean tutorial, it's really helping me get a footing trying to use Raylib.

  • @gamecubermemes4648
    @gamecubermemes4648 2 роки тому

    I had to watch this a few times and ask for some help before I fully understood it, but I get it now. Thanks for the great tutorial!

  • @remigoldbach9608
    @remigoldbach9608 4 роки тому +4

    I think you can divide by 6.0 so it will directly give you a float. Casting from integer, will occur to a loss of information. In this case it is not so important. But nice btw ! 👍🏻

  • @kellybmackenzie
    @kellybmackenzie Рік тому

    Thank you so much, you helped me so much!! ❤ This is really awesome!

  • @Andre-LA
    @Andre-LA 4 роки тому

    Awesome tutorial

  • @fsForward
    @fsForward 2 місяці тому

    Good video, well explained :D. Any way to scale too????

  • @happygofishing
    @happygofishing Рік тому

    👍for using DWM

  • @m4rt_
    @m4rt_ 2 роки тому +1

    Lol you change location and editor you use every episode so far of this series. Btw awsome series, bust one ive seen so far.

  • @eduardoabreu231
    @eduardoabreu231 5 років тому

    Awesome tutorial, did you encounter any issues using archlinux while programming? I'm on the edge of switching to a linux distro, but some softwares (cof cof adobe) are keeping me from switching
    Edit: I'm asking because I watched your first tutorial and you were using Windows, what made you switch?

    • @SkyVaultGames
      @SkyVaultGames  5 років тому

      I actually dual boot with linux and Windows, where I use Windows just for gaming.ive been using linux for several years and I havent had any problems using it. Im a heavy command line user and linux is fantastic for that. Though if you are thinking about trying Linux out I wouldnt recommend Arch, I would go for something like Mint

    • @eduardoabreu231
      @eduardoabreu231 5 років тому

      @@SkyVaultGames Oh, I actually prefer that way as well, how well 3d applications perform on arch linux? Like blender for example

  • @sathvikmalgikar2842
    @sathvikmalgikar2842 2 роки тому

    thanks.

  • @ozi-g-be
    @ozi-g-be 3 роки тому

    is there any way to un-draw the image?

  • @ben_yazi
    @ben_yazi 5 років тому

    Thanx for video) Is it a FreeBSD OS?))

    • @SkyVaultGames
      @SkyVaultGames  5 років тому

      No problem! Its actually Archlinux, though I've been curious to try out FreeBSD

  • @rooveloft5273
    @rooveloft5273 2 роки тому

    I don't know why but textures just won't load for me. Can you please tell me where to place the .png file and what exactly to write in the parameter of LoadTexture function? Thanks

  • @back2thecode914
    @back2thecode914 5 років тому

    it is a very good video, a pity that the quality of the image is weak

  • @ailuc9779
    @ailuc9779 Рік тому

    But what does the fourth param in func DrawTexturePro mean(origin)

  • @Mutombo71
    @Mutombo71 3 роки тому +4

    Great tutorial
    but isn't defining maxFrames a circular definition? Woldn't it be cleaner to
    maxFrames = 6; // you know that from the image
    float frameWidth = (float)(scarfy.width / maxFrames);

    • @PiyushJain-ct2qq
      @PiyushJain-ct2qq 2 роки тому +1

      He knows that for the current image but who know how may frames are there in any other image, so for those situations you can use this generic way

    • @professionalbreather62
      @professionalbreather62 Рік тому +2

      @@PiyushJain-ct2qq no, the point is frameWidth = image width / 6, where 6 is the max frames. then maxFrames is determined by image width / frameWidth, which is not very clear at all. It is much clearer if you state maxFrames as a constant and calculate frameWidth based on this constant.

  • @danielanderson222
    @danielanderson222 2 роки тому

    If Matt Damon and Ben Affleck had a baby together, it would look like Skyvault games and teach Raylib.

  • @RandomJeevanYT
    @RandomJeevanYT Місяць тому

    4:12 I did the same but its not drawing the image for me. Does the image have to be in .png format only?

    • @SkyVaultGames
      @SkyVaultGames  Місяць тому

      Raylib supports quite a few image formats actually, so I would check your path and see if its correct, sometimes the current working directory could be the wrong folder.
      github.com/raysan5/raylib/blob/master/FAQ.md#what-file-formats-are-supported-by-raylib

    • @RandomJeevanYT
      @RandomJeevanYT Місяць тому

      @@SkyVaultGames ye i saw that but by defualt jpg is disabled you have to change it in config.h and then recompile raylib which is a big headache so i just converted it to png format for now😅😅

    • @SkyVaultGames
      @SkyVaultGames  Місяць тому

      @@RandomJeevanYT Ah I totally forgot about that

  • @jakecomay9138
    @jakecomay9138 Рік тому

    Where can I find your make file?

    • @happygofishing
      @happygofishing Рік тому

      my makefile:
      BUILD_DIR=bin
      windows:
      gcc src/*.c -Wall -std=c99 -Wno-missing-braces -L lib/ms-windows -lraylib -lopengl32 -lgdi32 -lwinmm -o $(BUILD_DIR)/pong-c-windows
      r:
      bin/*
      linux:
      gcc src/*.c*.c -Wall -std=c99 -Wno-missing-braces -L lib/gnu-linux -lraylib -lglfw -lGL -lm -lpthread -ldl -lrt -lX11 -o $(BUILD_DIR)/pong-c-linux
      mac:
      clang --std=c99 src/*.c*.c -L lib/mac-osx -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL lib/mac-os -o $(BUILD_DIR)pong-c-macos
      clean:
      rm $(BUILD_DIR)/*

  • @arturkarlov3000
    @arturkarlov3000 5 років тому

    ok. seriously what is that code editor? this is different from the one in episode 2, right?

    • @SkyVaultGames
      @SkyVaultGames  5 років тому

      They are actually the same editor haha, Its called Vim, I'm constantly editing my vim config file so things do change quite often

    • @arturkarlov3000
      @arturkarlov3000 5 років тому

      @@SkyVaultGames you know, showing how this is done would be a cool idea for a tutorial. Also, showing how you set it up to work with raylib. Are you continuing with the raylib tutorials? They are quite helpful.

    • @SkyVaultGames
      @SkyVaultGames  5 років тому

      @@arturkarlov3000 I definitely wan't to do that. And yeah they will be continued, personal life has been getting in the way of that at the moment though.

    • @TheMFLORD
      @TheMFLORD 4 роки тому

      @@SkyVaultGames I would love to see a video of you compile and set up your workspace with vim. I tried switching to vim. But I found it quite hard to get anything going.

  • @grosnain
    @grosnain Місяць тому

    Do you know why CPP is called C++ ?
    While you write "frame += 1", ask yourself this question ;)

    • @SkyVaultGames
      @SkyVaultGames  Місяць тому

      frame++ is not my favorite operator, I avoid it purposefully
      EDIT: I should explain why, in C and C++ the '++' style operators are implementation dependent, so technically 'i++' could work like '++i' on some compilers, its best to avoid it IMO since 'i += 1' is explicit, there's no guess work on what it will do.

  • @morfy2581
    @morfy2581 Рік тому

    Mistake at 7:40
    You mean 1000 ms divided by 60

  • @user-if3py5yh5b
    @user-if3py5yh5b 2 місяці тому

    is this c or c++??

  • @ViaConDias
    @ViaConDias 11 місяців тому

    This is REALLY good. I do not understand why UA-cam doesn´t recommend this more.

  • @Sparkette
    @Sparkette 3 роки тому

    RAYWHITE is #F5F5F5, so you're displaying the image at only 96% brightness.

    • @SkyVaultGames
      @SkyVaultGames  3 роки тому

      I learned that shortly after making this video 🤦

  • @tastyham
    @tastyham 2 роки тому

    try colliding (spoiler u can't it's only drawing part of the spritesheet but the collisions of the rest is still here shame on u raylib)