October 31, 2020, 04:41:16 PM

Author Topic: Paint a texture.  (Read 518 times)

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 276
  • Blitz3d
    • Indiesoft
Paint a texture.
« on: April 09, 2020, 04:35:20 AM »
Hello, I have the following dilemma.

I found that making a menu using a shot in front of the camera, and drawing the menu in a texture buffer is very efficient.

The problem I have is that I don't know how to convert my Mousex () & mousey () position to the strings inside the texture.

It would be as if I wanted to paint a texture with the cursor, I remember seeing examples, but I can't find any, would they help me with that?


my menu method works like this. but i use a local mousex and mousey to draw a cursor inside the texture, but i need to use the real mouse screen.

Code: [Select]
Global camp_ventana
Global camp_textura
Global camp_show_ventana
Global camp_map_texture

Function update_campaing_3d(directorio$) ; PARTIDA CAMPA√ĎA   3d

DebugLog "INICIANDO CAMPAIGN MENU " + directorio
Local tam = 1024
Local margen = 11
Local escala = 5

Local pivot3d = CreatePivot()
Local pivot_selected = CreatePivot()

Local selected = 0

Local pointer_x#
Local pointer_z#

Local zoom# = 1

map_scale# =.1

c.campaing = First campaing

If camp_ventana = 0 Then
camp_ventana = LoadMesh("maps\sprite.b3d")
ScaleMesh camp_ventana,eo,eo,eo
ScaleEntity camp_ventana,2*escala,2*escala,2*escala
Else
DebugLog "GRAVE ERROR 1"

End If

;update_texture
If camp_textura = 0 Then
camp_map_texture = LoadTexture("maps\map.bmp")
EntityTexture camp_ventana,camp_map_texture
camp_textura = CreateTexture(tam,tam,g_vram_texture*256)
refresh = 1
Else
DebugLog "GRAVE ERROR 2"
End If

PositionEntity cam,0,0,0
RotateEntity cam,0,0,0
CameraRange cam,.001,1000
CameraZoom cam,1
ShowEntity camp_ventana
pos camp_ventana,cam
rot camp_ventana,cam
MoveEntity camp_ventana,0,0,2*escala
PointEntity camp_ventana,cam,-EntityRoll(cam,1)
EntityOrder camp_ventana,-500
EntityFX camp_ventana,1
EntityAlpha camp_ventana,1
EntityPickMode camp_ventana,2

While salir = 0
update_mouse_rel()
mouse_limited(margen,margen,tam-margen,tam-margen)

SetBuffer TextureBuffer(camp_textura)
....



Offline RemiD

  • Hero Member
  • *****
  • Posts: 1065
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 276
  • Blitz3d
    • Indiesoft
Re: Paint a texture.
« Reply #2 on: April 28, 2020, 03:11:56 PM »
Thanks RemiD!!!  ;D ;D ;D

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal